Skip to contentKino
Skip to Content

Drawer

A sheet on the bottom edge with a handle, snap points and drawers stacked on top.

npx shadcn add https://kinoui.com/r/drawer.json
Share on

Examples

Default

It slides up from the bottom edge with a handle on top. Swipe it down to close it.

Snap points

With snapPoints, it rests at more than one height. This one opens fully and is dragged down to a peek, and its handle becomes a button that does the same.

Content that changes height

When content appears or goes, the drawer moves to its new height.

A drawer on a drawer

Put the second Drawer inside the first one’s content. It stacks on top, and the first dims.

Recede

With variant="recede", the page in DrawerIndent steps back behind the drawer, as this page does, and a drawer steps back behind one opened on top of it.

Installation

npx shadcn@latest add https://kinoui.com/r/drawer.json
Files
lib/controllable.tslib/reduce-motion.tslib/grip.tslib/resize.tslib/scroll.tslib/panel.tsxlib/popup.tslib/refs.tslib/swap.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxcomponents/kino/sheet.tsxcomponents/kino/drawer.tsx
Packages
@base-ui/reactclass-variance-authority

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

Drawer

PropTypeDefaultDescription
snapPoints(number | string)[]NoneHeights it rests at: a number up to 1 is a share of the screen, a larger one pixels, or a string in px or rem.
snapPointnumberstringnullNoneThe snap point it is at, when you hold the state.
onSnapPointChange(snapPoint, details) => voidNoneCalled when it moves to another snap point.
variant'default''recede''default'recede steps the page in DrawerIndent back behind it, and steps a drawer back behind one opened on top of it.

CSS variables

VariableSet it onDefaultDescription
--sheet-recede-scale<html>, or DrawerIndent for the page only0.94How small the page gets behind a recede drawer, and how much a drawer behind another shrinks.
--sheet-recede-offset<html>, or DrawerIndent for the page only0.75remHow far the page drops behind a recede drawer, and how far a drawer behind another rises.

Accessibility

  • It follows the modal dialog pattern: focus moves in, Tab stays inside, and Escape or a press outside closes it.
  • A swipe is never the only way: the close button closes it, and with snap points the handle is a button named “Expand” or “Collapse”.
  • Its text can be selected with a mouse without dragging it.
  • When the system asks for less motion, the drawer fades in and out where it stands. A finger still drags it.