Centrim Design System — a token-first, accessible React component system.
Overlays & disclosure
Modal and non-modal surfaces for focused tasks and contextual detail, plus progressive-disclosure patterns for hiding secondary content until needed. All overlays are built on Radix primitives for focus trapping, dismissal and typeahead behaviour.
Overlay Surface
Floating contextual surfaces use a subtle glass treatment to create depth while maintaining readability and accessibility. Modal surfaces remain predominantly solid to preserve focus and clarity.
/* tokens: --overlay-surface, --overlay-surface-subtle, --overlay-border, --overlay-shadow, --overlay-backdrop, --overlay-blur */
When to use
- Soft Glass — Popover, DropdownMenu, ContextMenu, CommandMenu, HoverCard and Toast: translucent surface, 16px backdrop blur, hairline border, soft elevation.
- Subtle Glass — Drawer: near-solid surface with a reduced blur, because it is a large reading and editing surface.
- Solid — Dialog and AlertDialog: the existing surface, border and elevation tokens, unchanged.
When not to use
- Cards, tables, navigation and page chrome — glass belongs to floating surfaces only.
- Anything holding a destructive confirmation or a focused task.
- As decoration: the treatment supports hierarchy, it is never the visual focus.
Playground
Open each tier and compare it against the page behind: Soft Glass, then Subtle Glass, then Solid.
Surface tiers
Soft Glass
Popover · Dropdown · Command · Hover card · Toast
--overlay-surface
Subtle Glass
Drawer
--overlay-surface-subtle
Solid
Dialog · AlertDialog
--color-surface
Dialog
Modal window that interrupts the current task and requires an explicit action or dismissal. Use for focused, self-contained tasks like editing a record.
import { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from "@/design-system";
When to use
A focused edit or confirmation task that should block interaction with the page behind it. Avoid for content the user needs to reference alongside the page — use a Drawer or Popover instead.
Sizes
sm, md (default) and lg control the max width.
AlertDialog
A modal reserved for confirming actions that are destructive or otherwise hard to undo. Unlike Dialog, it cannot be dismissed by clicking outside — the user must choose Cancel or Action.
import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogAction, AlertDialogCancel } from "@/design-system";
When not to use
Don't use AlertDialog for routine confirmations or forms — reserve the forced choice for genuinely destructive actions to avoid alert fatigue.
Destructive confirmation
Tones
neutral, warning and destructive. Each renders a matching leading icon so the severity is never carried by colour alone.
Drawer
A modal panel that slides in from an edge of the screen. Suited to longer forms or detail views where a centred Dialog would feel cramped, or to mobile-style bottom sheets.
import { Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerFooter, DrawerClose } from "@/design-system";
When to use
Prefer Dialog for short, centred tasks; reach for Drawer when the content is a longer form, a filter panel, or benefits from an edge-anchored, larger surface.
Sides
right (default), left, top and bottom.
Popover
Non-modal panel anchored to a trigger, for small amounts of contextual content or a compact form. The page behind it stays interactive.
import { Popover, PopoverTrigger, PopoverContent, PopoverHeader, PopoverTitle, PopoverDescription, PopoverFooter, PopoverClose } from "@/design-system";
Compact form
Header and footer
PopoverHeader / PopoverTitle / PopoverDescription / PopoverFooter give filter and settings panels a consistent structure.
HoverCard
Reveals a small preview of content on hover or focus of a trigger, such as a user's profile summary behind their name.
import { HoverCard, HoverCardTrigger, HoverCardContent, HoverCardTitle, HoverCardDescription } from "@/design-system";
Author preview
HoverCardTitle and HoverCardDescription keep preview content typographically consistent; the avatar slot is optional.
Accordion
A set of expandable sections where headings summarise the content below. Supports single (one open at a time) or multiple open sections.
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@/design-system";
When to use
Grouped FAQ-style content or settings sections where most items stay collapsed. Avoid nesting more than one level, and avoid it for content users need to compare side by side.
Single, collapsible
Collapsible
The low-level show/hide primitive Accordion and Disclosure are built on. Use it directly when you need a bare expand/collapse region with fully custom trigger markup.
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@/design-system";
Custom trigger
Advanced options
Rate limits, retries and webhooks
Disclosure
A self-contained summary line with a chevron that reveals supporting detail — a simpler alternative to Accordion for a single expandable block.
import { Disclosure } from "@/design-system";
When to use
One optional block of extra detail (e.g. an error's stack trace, or terms and conditions). Use Accordion instead when you have several related sections.