Search

Search components and blocks

Sign in

Built from the Dialog and Switch components.

Cookie Preference Dialog

A real-world composition, not a new primitive — the compact Dialog, the Switch, per-category icons, and the ActionSwapButton for the save action, which confirms 'Saved!' before the dialog closes itself.

pnpm dlx shadcn@latest add @ditherui/cookie-preferences-dialog

Install

$ pnpm dlx shadcn@latest add @ditherui/cookie-preferences-dialog

Props

NecessarySwitch checked disabled, ShieldCheckIconalways on
Analytics / Marketing / FunctionalSwitch + onCheckedChange, per-category iconper-category state
Reject allresets every optional category to off, closes immediately—
Save preferencesActionSwapButton — confirms "Saved!", then closes the dialogresetAfter: 1100ms

Suggested components