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.

@tonal-tokensclsxtailwind-mergelucide-react

Installation

npx shadcn@latest add https://tonal.harlo.dev/r/tonal-dialog.json

Dependencies

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

PropTypeDefaultDescription
openboolean—Controls visibility.
onOpenChange(open: boolean) => void—Called on ESC, backdrop click, or close button.
titlestring—Accessible dialog heading.
descriptionstring—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.
footerReactNode—Optional right-aligned action footer.