All registry items
primitives/r/tonal-dialog.json
Tonal Dialog & Drawer
Accessible modal and slide-over drawer with ESC close and focus restoration.
Tonal Dialog & Drawer
Toggle Tablet or Mobile for real isolated iframe breakpoints, or switch to Code for full source.
Installation
npx shadcn@latest add https://tonal.harlo.dev/r/tonal-dialog.jsonDependencies
Tonal Registry Dependencies
npm Packages
clsxtailwind-mergelucide-react
Usage
import { TonalDialog } from "@/components/tonal/dialog";
<TonalDialog open={open} onOpenChange={setOpen} title="Create project" variant="modal">
...
</TonalDialog>Props & Tokens API
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | — | Controls visibility. |
| onOpenChange | (open: boolean) => void | — | Called on ESC, backdrop click, or close button. |
| title | string | — | Accessible dialog heading. |
| description | string | — | Optional subtitle linked via aria-describedby. |
| variant | "modal" | "drawer" | "modal" | Centered dialog or right-aligned slide-over sheet. |
| size | "sm" | "md" | "lg" | "md" | Max width preset. |
| footer | ReactNode | — | Optional right-aligned action footer. |