A panel that slides in from any edge, with swipe-to-dismiss, scroll lock and stacked nesting.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
npm packages it adds
- cn
- @base-ui/react
- @tabler/icons-react
- class-variance-authority
Code
import { Button } from "@/components/ui/button"
import {
Sheet,
SheetBody,
SheetClose,
SheetContent,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet"
export function SheetDemo() {
return (
<Sheet>
<SheetTrigger render={<Button variant="outline" />}>
Edit profile
</SheetTrigger>
<SheetContent>
<SheetHeader>
<SheetTitle>Edit profile</SheetTitle>
<SheetDescription>
Changes are saved to your account when you click save.
</SheetDescription>
</SheetHeader>
<SheetBody>
<div className="flex flex-col gap-4">
<div className="flex flex-col gap-1.5">
<label htmlFor="sheet-demo-name" className="text-sm font-medium">
Name
</label>
<input
id="sheet-demo-name"
defaultValue="Olivia Martin"
className="h-9 rounded-md border border-input bg-transparent px-3 text-sm transition-shadow outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-focus-ring focus-visible:outline-hidden pointer-coarse:text-touch"
/>
</div>
<div className="flex flex-col gap-1.5">
<label
htmlFor="sheet-demo-username"
className="text-sm font-medium"
>
Username
</label>
<input
id="sheet-demo-username"
defaultValue="@olivia"
className="h-9 rounded-md border border-input bg-transparent px-3 text-sm transition-shadow outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-focus-ring focus-visible:outline-hidden pointer-coarse:text-touch"
/>
</div>
</div>
</SheetBody>
<SheetFooter>
<SheetClose render={<Button variant="outline" />}>Cancel</SheetClose>
<SheetClose render={<Button />}>Save changes</SheetClose>
</SheetFooter>
</SheetContent>
</Sheet>
)
}
































