Skip to content

Sheets

Bottom and side sheets for supplementary content, modal or standing in the layout.

import { BottomSheet, SideSheet, SheetTrigger } from '@windmorph/react';

Purpose

Sheets hold supplementary content anchored to an edge of the window. A BottomSheet rises from the bottom for actions or content on a compact screen; a SideSheet sits at the end edge for filters or details (edge="start" for the other side; both are logical, so they swap in right-to-left pages). For a focused task or a decision use a dialog instead.

Modal sheets open from a SheetTrigger and cover a scrim. Either sheet can instead be variant="standard": a standard bottom sheet sits over the page without a scrim, collapsed to a peek height, and a standard side sheet sits in the layout and opens and closes its width. Every sheet needs a name (aria-label, aria-labelledby, or a side sheet's title).

Swipe to dismiss

On a touch screen, a swipe toward a modal side sheet's edge closes it once it passes half the sheet's width, or on a fling; a shorter swipe springs back. A vertical swipe still scrolls the content, and fields, sliders and horizontal scrollers inside keep their own drags. A mouse drag never moves it. Bottom sheets drag from their handle and, on touch, their content. swipeable={false} turns dragging off on either sheet (a bottom sheet's handle stays a button), and closedBy="none" stops a swipe from closing it.

To keep a sheet open after a swipe (unsaved changes), control open and leave it true in onOpenChange: the sheet springs back. The same check covers the close button, Escape and the scrim. Tell people why it stayed open, since a swipe that silently springs back feels broken.

M3 caps side sheets at 400px. A wider sheet that must break the spec can lift the cap with classNames.panel ("w-[480px] max-w-[480px]").

When not to use

For a focused decision that must block the screen use a Dialog.

See also

  • Sheets on m3.material.io: Material's own guidelines, with anatomy and specs.
  • Dialog: A modal surface for a focused task or a decision, with a title, content and actions, or full screen on compact windows.
  • Menu: A temporary list of choices anchored to a trigger, with groups, selection, submenus and context menus, or a bottom sheet on phones.