Dialog
A dialog that rises into the centre, and is a sheet on the bottom edge of a small screen.
Examples
Default
It rises into the centre and leaves faster than it came. On a screen under 640px wide it is a sheet on the bottom edge.
Long content
Put what can grow in DialogBody. It scrolls, and the header and the footer stay in place.
Without the close button
When the footer’s buttons are the answer, leave the close button out with showCloseButton={false}. Escape still closes it.
Content that changes height
When content appears or goes, the box moves to its new height and the footer stays on its bottom edge.
A dialog on a dialog
Put the second Dialog inside the first one’s content. The first steps back, and Escape closes only the one on top.
Controlled
A dialog opened with the open prop needs no trigger. When it closes, focus goes back to what had it before.
Installation
npx shadcn@latest add https://kinoui.com/r/dialog.json- Files
lib/reduce-motion.tslib/resize.tslib/scroll.tslib/panel.tsxlib/refs.tslib/swap.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/dialog.tsx- Packages
@base-ui/reactclass-variance-authority- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Dialog
DialogContent
DialogBody
CSS variables
Accessibility
- Focus moves into the dialog when it opens, Tab stays inside it, and Escape or a press outside closes it. Focus then goes back to the trigger.
- Every dialog needs a
DialogTitle, which names it for a screen reader. Give itsr-onlyto hide it. - While the body scrolls it takes focus first, so the arrow keys scroll it, and a screen reader hears it as a region named by the title.
- On a screen under 448px tall, such as a phone on its side, the whole dialog scrolls, so the body is never a slit.
- When the system asks for less motion, the dialog fades in and out where it stands, and a change of height is instant.