DocsComponentsAdvanced
NotificationCenter
React example follows below.
ts
import { NotificationCenter } from "@grassroot/ui-react/advanced"; const items = [ { id: "1", group: "Today", kind: "deploy", unread: true, time: "12m ago", message: <>ledger-api deployed</> }, { id: "4", group: "Yesterday", kind: "pr", unread: false, time: "19h ago", message: <>PR #482 merged</> },]; <NotificationCenter defaultItems={items} />No translated snippet for this adapter yet.
No translated snippet for this adapter yet.
No translated snippet for this adapter yet.
ts
import { NotificationCenter } from "@grassroot/ui-solid"; const items = [ { id: "1", group: "Today", kind: "deploy", unread: true, time: "12m ago", message: <>ledger-api deployed</> }, { id: "4", group: "Yesterday", kind: "pr", unread: false, time: "19h ago", message: <>PR #482 merged</> },]; export function Example() { return ( <> <NotificationCenter defaultItems={items} /> </> );}Installation
bash
pnpm dlx grassroot add ui/notification-centerbash
npx grassroot@latest add ui/notification-centerbash
yarn dlx grassroot add ui/notification-centerbash
bunx grassroot add ui/notification-centerAPI Reference
| Prop | Type | Default |
|---|---|---|
itemsControlled list. Pair with `onItemsChange`. | NotificationItem[] | undefined | — |
defaultItemsUncontrolled initial list. | NotificationItem[] | undefined | — |
onItemsChangeFired with the next list after mark-read / dismiss (controlled mode). | ((next: NotificationItem[]) => void) | undefined | — |
onOpenFired when a row's chevron is activated. | ((id: string) => void) | undefined | — |
titlePanel title. | string | undefined | "Notifications" |