Components
- Accordion
- Alert
- Alert Dialog
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Button
- Card
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Dialog
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Label
- Menu
- Meter
- Number Field
- Pagination
- Popover
- Preview Card
- Progress
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Skeleton
- Slider
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Toolbar
- Tooltip
Sheet
A flyout that opens from the side of the screen, based on the dialog component.
"use client"
import { Button } from "@/components/ui/button"
import { Field, FieldControl, FieldLabel } from "@/components/ui/field"
import { Form } from "@/components/ui/form"
import {
Sheet,
SheetClose,
SheetDescription,
SheetFooter,
SheetHeader,
SheetPopup,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet"
export default function DialogDemo() {
return (
<Sheet>
<SheetTrigger
render={(props) => (
<Button {...props} variant="outline">
Open Sheet
</Button>
)}
/>
<SheetPopup>
<Form>
<SheetHeader>
<SheetTitle>Edit profile</SheetTitle>
<SheetDescription>
Make changes to your profile here. Click save when you're
done.
</SheetDescription>
</SheetHeader>
<div className="flex flex-col gap-4 px-4">
<Field>
<FieldLabel>Name</FieldLabel>
<FieldControl type="text" defaultValue="Connor Love" />
</Field>
<Field>
<FieldLabel>Username</FieldLabel>
<FieldControl type="text" defaultValue="@loveconnor" />
</Field>
</div>
<SheetFooter>
<SheetClose
render={(props) => (
<Button {...props} variant="ghost">
Cancel
</Button>
)}
/>
<Button type="submit">Save</Button>
</SheetFooter>
</Form>
</SheetPopup>
</Sheet>
)
}
Installation
npx love-ui@latest add sheetUsage
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet"<Sheet>
<SheetTrigger>Open</SheetTrigger>
<SheetPopup>
<SheetHeader>
<SheetTitle>Are you absolutely sure?</SheetTitle>
<SheetDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</SheetDescription>
</SheetHeader>
</SheetPopup>
</Sheet>Examples
Side sheets
"use client"
import { Button } from "@/components/ui/button"
import {
Sheet,
SheetDescription,
SheetHeader,
SheetPopup,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet"
export default function DialogDemo() {
return (
<div className="flex flex-wrap gap-2">
<Sheet>
<SheetTrigger
render={(props) => (
<Button {...props} variant="outline">
Open Right
</Button>
)}
/>
<SheetPopup showCloseButton={false}>
<SheetHeader>
<SheetTitle>Right</SheetTitle>
<SheetDescription>Right side of the screen.</SheetDescription>
</SheetHeader>
</SheetPopup>
</Sheet>
<Sheet>
<SheetTrigger
render={(props) => (
<Button {...props} variant="outline">
Open Left
</Button>
)}
/>
<SheetPopup side="left" showCloseButton={false}>
<SheetHeader>
<SheetTitle>Left</SheetTitle>
<SheetDescription>Left side of the screen.</SheetDescription>
</SheetHeader>
</SheetPopup>
</Sheet>
<Sheet>
<SheetTrigger
render={(props) => (
<Button {...props} variant="outline">
Open Top
</Button>
)}
/>
<SheetPopup side="top" showCloseButton={false}>
<SheetHeader>
<SheetTitle>Top</SheetTitle>
<SheetDescription>Top of the screen.</SheetDescription>
</SheetHeader>
</SheetPopup>
</Sheet>
<Sheet>
<SheetTrigger
render={(props) => (
<Button {...props} variant="outline">
Open Bottom
</Button>
)}
/>
<SheetPopup side="bottom" showCloseButton={false}>
<SheetHeader>
<SheetTitle>Bottom</SheetTitle>
<SheetDescription>Bottom of the screen.</SheetDescription>
</SheetHeader>
</SheetPopup>
</Sheet>
</div>
)
}
Comparing with Radix / shadcn
If you’re already familiar with Radix UI and shadcn/ui, this guide highlights the small differences and similarities so you can get started with loveui quickly.
Quick Checklist
- Replace
asChild→renderonSheetTriggerand closing buttons - Prefer
SheetPopup;SheetContentremains for legacy - If you used
asChildon any other parts, switch to therenderprop
Comparison Example
<Sheet>
<SheetTrigger asChild>
<Button variant="outline">Show Sheet</Button>
</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Sheet Title</SheetTitle>
<SheetDescription>Sheet Description</SheetDescription>
</SheetHeader>
<SheetFooter>
<SheetClose asChild>
<Button variant="ghost">Cancel</Button>
</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet><Sheet>
<SheetTrigger render={<Button variant="outline" />}>
Show Sheet
</SheetTrigger>
<SheetPopup>
<SheetHeader>
<SheetTitle>Sheet Title</SheetTitle>
<SheetDescription>Sheet Description</SheetDescription>
</SheetHeader>
<SheetFooter>
<SheetClose render={<Button variant="ghost" />}>Cancel</SheetClose>
</SheetFooter>
</SheetPopup>
</Sheet>