Notification preferences
ProWhat people are told about and where: every event against email, in-app and push, one switch per group that shows when only some are on, a digest for the rest, and a pause with a visible end.
pnpm dlx shadcn@latest add @caliper/notification-preferences| Event | In app | Push | |
|---|---|---|---|
| Your work | |||
| MentionsSomeone @mentions you in a comment. | |||
| Assigned to youA ticket, task or invoice is given to you. | |||
| Due soonSomething of yours is due within a day. | |||
| Your team | |||
| ApprovalsAn expense or payment waits for you. | |||
| New membersSomeone joins the workspace. | – | ||
| Account and security | |||
| New sign-inYour account is used on a new device. | |||
| BillingReceipts, failed payments and plan changes. | – |
Checked and greyed out: always sent, such as security alerts.
When to use #
Use it for
- The notifications page in account settings.
- Any product that sends more than a handful of kinds of message.
Skip it when
- A single on/off for one kind of email; use a switch in a settings row.
Installation #
pnpm dlx shadcn@latest add @caliper/notification-preferences
Adds its 8 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage #
Import it from your copy of the source. The example behind the preview comes with the source.
import { NotificationPreferences } from "@/components/ui/notification-preferences"
The worked example comes with Pro
The 79-line example behind the preview opens here with a Pro or Team licence.
API reference #
NotificationPreferences
component
Accessibility #
It exposes status semantics, with aria-label, aria-hidden, aria-labelledby and aria-disabled kept in step with state. Changes that matter are announced through a live region.
Keyboard and focus handling comes from Radix popover: arrow keys move through items, Enter and Space select, and Escape closes and returns focus.
Motion #
Transitions use the shared duration and easing tokens. Under prefers-reduced-motion those tokens collapse to instant and travel distances go to zero, so state changes still happen without movement.