shadcn.io is not affiliated with official shadcn/ui
Drawer examples · Right
Right Drawer Notifications for React
A right drawer listing notifications, with an unread dot on new ones and a Mark all as read button.
A notifications panel in a right drawer, opened from a bell with a count Badge. Each notification is a button with a dot, the title, a line of detail and the time; unread ones get a primary dot and a medium weight. The list scrolls on its own.
Preview
Installation
FAQ
How is the bell button labeled?
It's icon-only, so aria-label gives the name and the count: Notifications, 5 unread. The badge is aria-hidden, so the count isn't read twice.
How are unread notifications marked?
A primary dot, a medium-weight title and a visually hidden Unread before the title. Read ones get a muted dot and regular weight, so the state isn't color alone.
Why is each notification a button?
So people can open it with a click or the keyboard. The rows have no handler yet: open the related page from each one.
Does Mark all as read clear the dots?
It's a DrawerClose, so it closes the drawer; it doesn't change the data. Keep the notifications in state and set them all read when it's pressed.
Related
- Simple Right DrawerA drawer that slides in from the right
- Right Drawer Shopping CartA right drawer shopping cart with three
- Left Drawer File ExplorerA left drawer with a file tree whose
- Right Drawer Filter PanelA right drawer of product filters
- Right Drawer Settings PanelA right drawer of settings switches
- Bottom Drawer Event DetailsA bottom drawer with an event's badges