81 Pro components and page blocks

Get Pro

Notification Center

New

Preview

Customize

End
Count
Width380px
Max height440px
Accent

Installation

npx shadcn@latest add https://uibrik.com/r/notification-center.json
Adds the files to components/uibrik/notification-center and installs @number-flow/react, @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/notification-center.

Usage

import { NotificationCenter } from "@/components/uibrik/notification-center/notification-center";​<NotificationCenter  align="end"  badge="count"  width={380}  maxHeight={440}  closeOnSelect={false}  accent=""  defaultNotifications={[]}  label="Notifications"  onSelect={(notification) => {}}  // notifications={[…]}  // onNotificationsChange={(list) => {}}  // open={false}  // onOpenChange={(open) => {}}  // footer={<…/>}/>

Props

NotificationCenter
align
Type "start" | "center" | "end"
"end"
Which edge of the bell the panel lines up with.
badge
Type "count" | "dot"
"count"
Show how many are unread, or just that some are.
width
Type number
380
Panel width. Never wider than the screen.
maxHeight
Type number
440
Tallest the list grows before it scrolls.
closeOnSelect
Type boolean
false
Close the panel after a notification is opened.
accent
Type string
""
Badge and unread-dot colour. Empty uses the text colour.
notifications / onNotificationsChange
Type Notification[] / (list) => void
–
Controlled list, newest first. Each is { id, title, time, name?, body?, read?, avatar?, icon? }.
defaultNotifications
Type Notification[]
[]
Starting list when uncontrolled.
onSelect
Type (notification) => void
–
Called when a row is opened. It is marked read as well.
open / onOpenChange
Type boolean / (open) => void
–
Controlled open state.
label
Type string
"Notifications"
Panel heading and the bell's accessible name.
footer
Type ReactNode
–
Under the list, e.g. a link to a full inbox.
className
Type string
–
Classes for the bell button.