crucıble

Tocsin

Notification center block: a bell whose unread badge rolls on Tally digit drums and swings once when something arrives, opening an anchored dialog (or inline panel) with All / Mentions / Archived tabs on Detent, sticky Today / Yesterday / Earlier groups, rich-text rows with avatars or system glyphs, inline Accept/Decline that collapse into a receipt, swipe-left or hover-button archive with a height collapse, staggered Mark all read, and push() that slides new items in with an accent flash. Roving keyboard focus with R / E shortcuts and a polite live region.

motionpro

Installation

CLI

npx shadcn@latest add @crucible/tocsin

Manual — install dependencies, then copy the source

npm install motion

Props

PropTypeDefaultDescription
itemsTocsinItem[]a seeded sample inboxInitial notifications (the inbox owns read/archived state afterwards and reports it through the callbacks). Passing a new array resets the inbox.
onAction(item: TocsinItem, actionId: string) => void | Promise<unknown>Fired when an inline action is clicked. Return a Promise to hold the button in a pending state — resolve collapses the actions into the receipt line; reject shows the rejection message inline.
onRead(item: TocsinItem, read: boolean) => voidFired when a notification is marked read (read: true) or unread (read: false).
onArchive(item: TocsinItem, archived: boolean) => voidFired when a notification is archived (archived: true) or restored (archived: false).
onItemsChange(items: TocsinItem[]) => voidFired after every change with the full list.
inlinebooleanfalseRender the panel in place (no bell trigger / popover).
openbooleanControlled popover state.
onOpenChange(open: boolean) => voidPopover open-state changes (bell click, Escape, outside click, open()/close()).
align"start" | "end""end"Popover edge aligned to the bell.
titlestring"Notifications"Panel heading.
shortcutsbooleantrueShow the keyboard-shortcut footer (hidden below ~420px wide regardless).
accentColorstring"#fb7185"The single accent: badge, unread dots, focus rings, new-item flash, primary actions. Any CSS color; hex gets auto-contrast ink.
refReact.Ref<TocsinHandle>Imperative handle — push(), open(), close(), markAllRead(), replay(), getItems().
classNamestringClasses for the root (the panel in inline mode, the trigger wrapper otherwise).
panelClassNamestringClasses for the panel (popover mode) — e.g. a width or height.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.