Skip to main content

Starwind UI v3.0 is now available! Migration guide

Edit Profile

Make changes to your profile here. Click save when youโ€™re done.

Installation

Usage

---
import { Button } from "@/components/starwind/button";
import { Input } from "@/components/starwind/input";
import { Label } from "@/components/starwind/label";
import {
Sheet,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/starwind/sheet";
---
<Sheet>
<SheetTrigger asChild>
<Button>Open Sheet</Button>
</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Edit Profile</SheetTitle>
<SheetDescription>
Make changes to your profile here. Click save when you're done.
</SheetDescription>
</SheetHeader>
<div class="grid gap-4 px-4">
<div class="grid gap-2">
<Label for="name">Name</Label>
<Input id="name" value="Pedro Duarte" />
</div>
<div class="grid gap-2">
<Label for="username">Username</Label>
<Input id="username" value="@peduarte" />
</div>
</div>
<SheetFooter>
<SheetClose asChild>
<Button type="submit">Save changes</Button>
</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>

Composition

Use this structure for a sheet:

Sheet
โ”œโ”€โ”€ SheetTrigger
โ””โ”€โ”€ SheetContent
โ”œโ”€โ”€ SheetHeader
โ”‚ โ”œโ”€โ”€ SheetTitle
โ”‚ โ””โ”€โ”€ SheetDescription
โ””โ”€โ”€ SheetFooter

SheetContent includes a close button. Use SheetClose when another control also needs to close the sheet.

When to Use

Use Sheet for supporting content that slides in from an edge, such as a form or mobile navigation.

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

Styled Component API

These props are added or materially changed by the installed styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Expand a prop to see named type definitions and framework-specific imports. Follow the Primitive and Runtime links for lower-level behavior props.

Sheet Trigger

Inherits button attributes.

Contains the following additional props:

Prop Type Default Toggle details
asChild boolean false
Description
Merges the component behavior and props into its child element.
Classification
Wrapper prop

Sheet Close

Inherits button attributes.

Contains the following additional props:

Prop Type Default Toggle details
asChild boolean false
Description
Merges the component behavior and props into its child element.
Classification
Wrapper prop

Primitive And Runtime API

Use these references when you need the lower-level behavior APIs behind Sheet.

Primitive API

Runtime API

Drawer primitive
createDrawer from @starwind-ui/runtime/drawer

Changelog

View version history v2.0.2 2 releases

v2.0.2

  • Named the generated aggregate default export so React and Astro tooling can identify the installed component cleanly.

v2.0.0

  • Rebuilt Sheet on Starwind Runtime while preserving its styled API over the shared Drawer behavior.
  • See the Drawer Primitive for the underlying unstyled anatomy and behavior API.