Dialog
A focused surface for decisions that need attention.
A temporary side surface for focused work.
npx shadcn@latest add @silicon-ui/drawernpx shadcn@latest add @silicon-ui/drawerInstall the dependencies.
npm install @radix-ui/react-dialog lucide-react motionCopy these files into your project. Shared files are skipped if you already have them.
components/silicon-ui/drawer/drawer.tsxcomponents/silicon-ui/drawer/drawer.module.csscomponents/silicon-ui/lib/escape.ts sharedcomponents/silicon-ui/lib/return-focus.ts sharedInstall the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation
DrawerAccepts the props of DialogProps.
DrawerContent| Prop | Type | Default |
|---|---|---|
title* | string | — |
children* | ReactNode | — |
description | string | — |
side | "left" | "right" | "top" | "bottom" | "right" |
containerRenders the drawer inside this element instead of the page body, anchored to its edges. The element needs position: relative and overflow: hidden. | HTMLElement | null | — |
Also accepts the props of ComponentPropsWithoutRef<typeof DialogPrimitive.Content>.
DrawerTriggerAccepts the props of ButtonHTMLAttributes.
DrawerCloseAccepts the props of ButtonHTMLAttributes.