Skip to main content

Starwind UI v1.12 is now available!

Sheet

Edit Profile

Make changes to your profile here. Click save when you’re done.

Installation

Usage

General Notes

Sheets are slide-out panels that can extend from any edge of the screen. They’re built on top of the Dialog component and are great for forms and mobile navigation menus.

The essential components are Sheet, SheetTrigger, and SheetContent. The SheetHeader, SheetFooter, SheetTitle, and SheetDescription components provide additional structure.

side

Sheets can slide out from any side of the screen using the side prop.

Top Sheet

This sheet opens from the top of the screen.

Right Sheet

This sheet opens from the right side of the screen.

Bottom Sheet

This sheet opens from the bottom of the screen.

Left Sheet

This sheet opens from the left side of the screen.

API Reference

Sheet

The root component that manages the sheet state. Built on top of the Dialog component.

PropTypeDefault
classNamestring-
<Sheet>
<SheetTrigger>Open Sheet</SheetTrigger>
<SheetContent>
<!-- Sheet content -->
</SheetContent>
</Sheet>

Additional Notes:

  • Inherits all accessibility and behavior props from the Dialog component

SheetTrigger

A button that opens the sheet when clicked.

PropTypeDefault
asChildbooleanfalse
forstring-
classNamestring-
<SheetTrigger asChild>
<Button>Open Sheet</Button>
</SheetTrigger>
<!-- Or as a standalone button -->
<SheetTrigger>Open Sheet</SheetTrigger>

Additional Notes:

  • asChild: When enabled, applies sheet trigger behavior to the child element (like a link or custom button)
  • for: Optional ID to associate with a specific sheet when not using direct parent-child relationship

SheetContent

The slide-out panel container that appears when the sheet is opened.

PropTypeDefault
side"top" | "right" | "bottom" | "left""right"
classNamestring-
<SheetContent side="right" class="w-[400px] sm:w-[540px]">
<!-- Sheet content goes here -->
</SheetContent>

SheetHeader

A container for the sheet title and description.

PropTypeDefault
classNamestring-
<SheetHeader>
<SheetTitle>Sheet Title</SheetTitle>
<SheetDescription>Sheet description</SheetDescription>
</SheetHeader>

SheetTitle

The title of the sheet. Automatically receives proper heading semantics.

PropTypeDefault
classNamestring-
<SheetTitle>
Edit Profile
</SheetTitle>

SheetDescription

A description that provides additional context about the sheet.

PropTypeDefault
classNamestring-
<SheetDescription>
Make changes to your profile here. Click save when you're done.
</SheetDescription>

SheetFooter

A container for action buttons, typically containing cancel and confirm buttons.

PropTypeDefault
classNamestring-
<SheetFooter>
<SheetClose asChild>
<Button variant="outline">Cancel</Button>
</SheetClose>
<Button>Save</Button>
</SheetFooter>

Additional Notes:

  • Typically contains action buttons like save, cancel, or close

SheetClose

A button that closes the sheet when clicked.

PropTypeDefault
asChildbooleanfalse
classNamestring-
<SheetClose asChild>
<Button>Close</Button>
</SheetClose>
<!-- Or as a standalone button -->
<SheetClose>Close</SheetClose>

Additional Notes:

  • asChild: When enabled, applies close functionality to the child element while preserving its appearance
  • Can be used anywhere within the sheet content, not just in the footer
  • Automatically handles sheet closing when clicked or activated via keyboard

Changelog

v1.1.1

  • Add named slots “icon” and “backdrop” to SheetContent to enable easy icon swapping and backdrop replacement

v1.1.0

  • style and focus state updates

v1.0.0

  • Initial release with starwind v1.9.0