Dialog
Radix dialog with the Layro motion and a title the component insists on, so a screen reader always announces what opened. ConfirmDialog handles the destructive case: an alertdialog, an optional type-to-confirm, and a Promise-aware action that shows its own pending state.
The decision inside it
Clicking the backdrop does not destroy a form
A dialog holding typed input closes on Escape or the button, not on a stray click outside it.
Installation
How you get it
One command. The CLI writes the file into components/ui/ and installs what it needs.
npx shadcn@latest add https://layropro.com/r/dialogAPI
“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Prop | Type | Notes |
|---|---|---|
titlerequired | React.ReactNode | Rendered as the dialog's accessible name. Required — use `hideTitle` if the design has no visible title. |
description | React.ReactNode | One or two sentences: what happens, and what it affects. |
hideTitle | boolean | Keep the title for screen readers only. |
size | keyof typeof WIDTH | — |
showClose | boolean | Show the × in the corner. Default true. |
Dependencies
npm packages
@radix-ui/react-dialogclsxlucide-reacttailwind-mergeLayro foundations, installed alongside it
layro-themebuttonLifetime access
Every component, and everything we ship next.
- All 65 components, source included
- The template, and everything released after you buy
- shadcn CLI or download — React 18/19, Tailwind v4
- One payment. No subscription.