Skip to content
sdocs

Notice

Kitchen sink: every documented feature in one component — text, number, boolean, and union props; events; plain and parameterized snippets; methods; exported state; and annotated CSS custom properties.

`count` past 99 widens the title row — see the Repeated example.

Re-renders every child on a `tone` change, snippets included.

One Notice per region; a stack of them reads as noise.

The kitchen sink — this page exists to exercise every documented feature at once, not to model a real component doc.

Also the corpus the language-server and formatter tests run against.

  • callout
  • alert
  • admonition
  • banner

Props

Name
Details
Default
Control
title*
string
Default
Control
Heading of the notice
tone
'info'| 'success'| 'warning'| 'danger'
Default info
Control
Visual tone of the dot next to the title
dismissible
boolean
Default true
Control
Show the dismiss button
count
number
Default 1
Control
Badge with the number of occurrences
action
NoticeAction
Default
Control
Optional action button rendered under the body

CSS Props

Name
Details
Default
Control
--notice-accent
color
Default hsl(221 83% 53%)
Control
Accent border and title color (default: hsl(221 83% 53%))
--notice-bg
color
Default hsl(240 5% 97%)
Control
Background color (default: hsl(240 5% 97%))
--notice-pad
dimension
Default 14px
Control
Inner padding
--notice-radius
dimension
Default 10px
Control
Corner radius

Events

Name
Details
ondismiss
() => void
Called when the notice is dismissed
onshow
(shows: number) => void
Called when the notice is shown again, with the total show count

Snippets

Name
Details
icon
Snippet<[tone: string]>
Leading icon; receives the current tone
children
Snippet
Body content

Methods

Name
Details
Control
dismiss
() => void
Control
Hide the notice
show
() => void
Control
Show the notice again

States

Name
Details
Current value
stats
Current value
Live counters: how often the notice was shown and dismissed

Examples

WithIconSnippet

  • icon
  • snippet
  • warning

Repeated

  • count
  • badge

WithAction

Themed