Notification List
betaNotifications resting as a receding deck that springs open into a list on hover, focus or toggle, with cards that slide out when dismissed or swiped and a count that rolls.
- Feedback
- 1 file
- 2 npm packages
- Accessibility notes
- Animates with motion
pnpm dlx @dowel-ui/cli add notification-listnpm packages installed: class-variance-authority, motion.
import { NotificationList } from "@/components/ui/notification-list";Default
Expanded
Plain
Live
<NotificationList>
| Prop | Type | Default |
|---|---|---|
announceDismissWhat the status region says after a dismissal. | (item: NotificationListItem) => string | defaultAnnounce |
defaultExpandedStarts fanned out, as if the toggle had been pressed. | boolean | false |
defaultItemsThe notifications at first render (uncontrolled). | NotificationListItem[] | [] |
depthCards visible in the collapsed deck, including the top one. | number | 3 |
dismissLabelThe dismiss button's name. | (item: NotificationListItem) => string | defaultDismissLabel |
emptyMessageShown when there is nothing left. | ReactNode | "You're all caught up" |
itemsThe notifications, newest first (controlled — remove dismissed ones in | NotificationListItem[] | — |
labelThe header text, which also names the region. | string | "Notifications" |
onDismissCalled when a notification is dismissed, by button or by swipe. | (id: string, item: NotificationListItem) => void | — |
swipeToDismissLets a sideways drag dismiss a card. The × button always works. | boolean | true |
variant | "card" | "plain" | "card" |
Plus every attribute of <section> except children, defaultValue.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes