Skip to content

Sheet Presentation

Present an overlay as a bottom sheet on touch and keep the popover under a pointer.

import { SheetHandle, SheetLayer } from '@youj/react'

Experimental: what this label means

Menus, selects and pickers are popovers under a mouse. Under a thumb they are bottom sheets: they rise from the bottom edge where the hand already is, rows are 48px, and a pull down dismisses them. Dropdown Menu, Select, Popover, Combobox, Multi-select, Command, Context Menu and the date and color pickers do this on their own. This page is for building your own overlay the same way.

The same Base UI primitive drives both presentations, so roles, focus order, typeahead, controlled state and events do not change. Only the placement, the surface and the way it is dismissed do.

Installation

npm i @youj/react

import { SheetHandle, SheetLayer } from '@youj/react'

For an app already set up with npx @youj/cli init, which installs the peers (@youj/core, @youj/motion, motion and Base UI) and wires the provider. New app? Start at Installation.

Examples

Choosing the presentation

Every overlay in the library takes presentation on its content part.

ValueBehavior
auto (default)A sheet on touch, a popover under a pointer.
sheetAlways a sheet.
popoverAlways a popover, also on touch.

auto follows the device: the primary pointer, or the device you set on YoujProvider or ThemeScope. It never follows the width of the window. A narrow desktop window is not touch, and a wide tablet is.

Reference

Reduced motionWith reduced motion the sheet appears and leaves instantly, and a…

Reduced motion

With reduced motion the sheet appears and leaves instantly, and a drag still tracks the finger.

AccessibilityKeyboard, ARIA, focus

Accessibility

The primitive keeps its roles and its focus management. The handle is aria-hidden: pulling down is a shortcut for Escape, never the only way out.