Sheet

Sliding panel for dialogs, forms, and multi-step flows. Built on Base UI Dialog with motion-powered animations.

Overview

The Sheet component presents content in a panel that slides from any edge of the viewport. It's ideal for lightweight flows such as settings, filters, or multi-step forms. Built on Base UI Dialog primitives with Framer Motion for smooth, customizable animations.

Usage

import {
  Sheet,
  SheetTrigger,
  SheetContent,
  SheetHeader,
  SheetBody,
  SheetFooter,
  SheetTitle,
  SheetDescription,
  SheetClose,
} from "@tilt-legal/cubitt-components/primitives";
<Sheet>
  <SheetTrigger render={<Button />}>Open Sheet</SheetTrigger>
  <SheetContent side="right">
    <SheetHeader>
      <SheetTitle>Sheet Title</SheetTitle>
      <SheetDescription>Sheet description goes here.</SheetDescription>
    </SheetHeader>
  </SheetContent>
</Sheet>

Examples

Basic

With Actions

With Form

Different Sides

Sheets can slide in from any edge of the viewport.

Floating Sheet

Scrollable Content

Sheet with long content that scrolls. The header and footer remain sticky with a blurred background effect.

Without Close Button

URL State

Sheet with URL state synchronization for shareable sheet states.


API Reference

Sheet

Root component that manages sheet state.

PropTypeDefaultDescription
openboolean-Controlled open state of the sheet.
defaultOpenbooleanfalseDefault open state for uncontrolled usage.
onOpenChange(open: boolean) => void-Callback fired when the open state changes.
modalbooleantrueWhether the sheet is modal (locks scroll).

URL State Props

The following props enable URL state management by syncing the sheet open/closed state with URL parameters via TanStack Router search params. When paramName is provided, the sheet's state will be reflected in the URL.

PropTypeDefaultDescription
paramNamestring-URL parameter name for syncing state with URL. When provided, enables URL state management.
paramMatchValuestring-Value that must match for the sheet to open.
onUrlValueChange(value: boolean | null) => void-Callback when URL parameter value changes.
paramClearOnDefaultbooleantrueRemove URL param when value equals default.
paramThrottlenumber-Throttle URL updates in milliseconds.
paramDebouncenumber-Debounce URL updates in milliseconds.

SheetTrigger

Button that opens the sheet.

PropTypeDefaultDescription
renderReact.ReactElement-Custom trigger element to render.

SheetContent

Container for the sheet content with backdrop and animations.

PropTypeDefaultDescription
side'top' | 'right' | 'bottom' | 'left''right'Which edge the sheet slides from.
floatbooleanfalseRenders content as a floating card with rounded corners and border.
showCloseButtonbooleantrueShow a built-in close button in the corner.
classNamestring-Additional CSS classes for the sheet popup.

SheetHeader / SheetFooter

Container components for sheet header and footer with sticky positioning.

PropTypeDefaultDescription
classNamestring-Additional CSS classes for the header.

SheetBody

Container for the main content area with consistent padding.

PropTypeDefaultDescription
classNamestring-Additional CSS classes for the body.

SheetTitle

The accessible title of the sheet.

PropTypeDefaultDescription
classNamestring-Additional CSS classes for the title.

SheetDescription

Description text that provides context about the sheet.

PropTypeDefaultDescription
classNamestring-Additional CSS classes for the description.

SheetClose

Button that closes the sheet.

PropTypeDefaultDescription
renderReact.ReactElement-Custom close button element to render.
classNamestring-Additional CSS classes for the close button.

On this page