Sheet
Proshadcn's sheet (Radix dialog from an edge) in Candor's theme.
Preview
Install
First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/sheet
Brings in: locale, render-prop, utils · npm: lucide-react@^1.67.0, radix-ui@^1.8.1
Usage
"use client"
import { Button } from "@/components/ui/button"
import { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"
export default function Example() {
return (
<Sheet>
<SheetTrigger asChild>
<Button variant="outline">Flag details</Button>
</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>checkout.new_tax_engine</SheetTitle>
<SheetDescription>On for 10% of Production traffic since Tuesday. Owned by the payments team.</SheetDescription>
</SheetHeader>
<div className="px-4 text-sm text-muted-foreground">Read by the checkout API and the invoice worker. No errors in the last 24 hours.</div>
<SheetFooter>
<SheetClose asChild>
<Button variant="outline">Close</Button>
</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>
)
}<Sheet>
No props.
Also takes the props of React.ComponentProps<typeof SheetPrimitive.Root>.
<SheetTrigger>
No props.
Also takes the props of React.ComponentProps<typeof SheetPrimitive.Trigger>RenderProp.
<SheetClose>
No props.
Also takes the props of React.ComponentProps<typeof SheetPrimitive.Close>RenderProp.
<SheetContent>
| Prop | Type | Default | Description |
|---|---|---|---|
| side | "top" | "right" | "bottom" | "left" | undefined | "right" | The edge the sheet slides in from. Defaults to right. |
| showCloseButton | boolean | undefined | true | Shows the close (×) button. Defaults to true. |
Also takes the props of React.ComponentProps<typeof SheetPrimitive.Content>.
<SheetHeader>
No props.
Also takes the props of React.ComponentProps<"div">.
<SheetFooter>
No props.
Also takes the props of React.ComponentProps<"div">.
<SheetTitle>
No props.
Also takes the props of React.ComponentProps<typeof SheetPrimitive.Title>.
<SheetDescription>
No props.
Also takes the props of React.ComponentProps<typeof SheetPrimitive.Description>.
Strings
The fixed words, in English by default. Change any of them under sheet in <LocaleProvider strings={{ … }}>; the table is exported as sheetStrings.
| Key | English |
|---|---|
| close | Close |