Files
shadcn-ui/apps/v4/public/r/styles/base-nova/sheet-example.json
shadcn 47c47eaed2 feat: add docs for base-ui components (#9304)
* feat: add base and radix docs

* feat: transform code for display

* fix

* fix

* fix

* fix

* fix

* chore: remove claude files

* fix

* fix

* fix

* chore: run format:write

* fix

* feat: add more examples

* fix

* feat: add aspect-ratio

* feat: add avatar

* feat: add badge

* feat: add breadcrumb

* fix

* feat: add button

* fix

* fix

* fix

* feat: add calendar and card

* feat: add carousel

* fix: chart

* feat: add checkbox

* feat: add collapsible

* feat: add combobox

* feat: add command

* feat: add context menu

* feat: add data-table dialog and drawer

* feat: dropdown-menu

* feat: add date-picker

* feat: add empty

* feat: add field and hover-card

* fix: input

* feat: add input

* feat: add input-group

* feat: add input-otp

* feat: add item

* feat: add kbd and label

* feat: add menubar

* feat: add native-select

* feat: add more components

* feat: more components

* feat: more components

* feat: add skeleton, slider and sonner

* feat: add spinner and switch

* feat: add more components

* fix: tabs

* fix: tabs

* feat: add docs for sidebar

* fix

* fix

* fi

* docs: update

* fix: create page

* fix

* fix

* chore: add changelog

* fix
2026-01-20 19:31:38 +04:00

20 lines
5.2 KiB
JSON

{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "sheet-example",
"title": "Sheet",
"registryDependencies": [
"button",
"field",
"input",
"sheet",
"example"
],
"files": [
{
"path": "registry/base-nova/examples/sheet-example.tsx",
"content": "import {\n Example,\n ExampleWrapper,\n} from \"@/registry/base-nova/components/example\"\nimport { Button } from \"@/registry/base-nova/ui/button\"\nimport { Field, FieldGroup, FieldLabel } from \"@/registry/base-nova/ui/field\"\nimport { Input } from \"@/registry/base-nova/ui/input\"\nimport {\n Sheet,\n SheetClose,\n SheetContent,\n SheetDescription,\n SheetFooter,\n SheetHeader,\n SheetTitle,\n SheetTrigger,\n} from \"@/registry/base-nova/ui/sheet\"\n\nexport default function SheetExample() {\n return (\n <ExampleWrapper>\n <SheetWithForm />\n <SheetNoCloseButton />\n <SheetWithSides />\n </ExampleWrapper>\n )\n}\n\nfunction SheetWithForm() {\n return (\n <Example title=\"With Form\">\n <Sheet>\n <SheetTrigger render={<Button variant=\"outline\" />}>Open</SheetTrigger>\n <SheetContent>\n <SheetHeader>\n <SheetTitle>Edit profile</SheetTitle>\n <SheetDescription>\n Make changes to your profile here. Click save when you&apos;re\n done.\n </SheetDescription>\n </SheetHeader>\n <div className=\"style-vega:px-4 style-maia:px-6 style-mira:px-6 style-lyra:px-4 style-nova:px-4\">\n <FieldGroup>\n <Field>\n <FieldLabel htmlFor=\"sheet-demo-name\">Name</FieldLabel>\n <Input id=\"sheet-demo-name\" defaultValue=\"Pedro Duarte\" />\n </Field>\n <Field>\n <FieldLabel htmlFor=\"sheet-demo-username\">Username</FieldLabel>\n <Input id=\"sheet-demo-username\" defaultValue=\"@peduarte\" />\n </Field>\n </FieldGroup>\n </div>\n <SheetFooter>\n <Button type=\"submit\">Save changes</Button>\n <SheetClose render={<Button variant=\"outline\" />}>Close</SheetClose>\n </SheetFooter>\n </SheetContent>\n </Sheet>\n </Example>\n )\n}\n\nfunction SheetNoCloseButton() {\n return (\n <Example title=\"No Close Button\">\n <Sheet>\n <SheetTrigger render={<Button variant=\"outline\" />}>\n No Close Button\n </SheetTrigger>\n <SheetContent showCloseButton={false}>\n <SheetHeader>\n <SheetTitle>No Close Button</SheetTitle>\n <SheetDescription>\n This sheet doesn&apos;t have a close button in the top-right\n corner. You can only close it using the button below.\n </SheetDescription>\n </SheetHeader>\n </SheetContent>\n </Sheet>\n </Example>\n )\n}\n\nconst SHEET_SIDES = [\"top\", \"right\", \"bottom\", \"left\"] as const\n\nfunction SheetWithSides() {\n return (\n <Example title=\"Sides\">\n <div className=\"flex flex-wrap gap-2\">\n {SHEET_SIDES.map((side) => (\n <Sheet key={side}>\n <SheetTrigger\n render={<Button variant=\"outline\" className=\"capitalize\" />}\n >\n {side}\n </SheetTrigger>\n <SheetContent\n side={side}\n className=\"data-[side=bottom]:max-h-[50vh] data-[side=top]:max-h-[50vh]\"\n >\n <SheetHeader>\n <SheetTitle>Edit profile</SheetTitle>\n <SheetDescription>\n Make changes to your profile here. Click save when you&apos;re\n done.\n </SheetDescription>\n </SheetHeader>\n <div className=\"no-scrollbar style-vega:px-4 style-maia:px-6 style-mira:px-6 style-lyra:px-4 style-nova:px-4 overflow-y-auto\">\n {Array.from({ length: 10 }).map((_, index) => (\n <p\n key={index}\n className=\"style-lyra:mb-2 style-lyra:leading-relaxed mb-4 leading-normal\"\n >\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed\n do eiusmod tempor incididunt ut labore et dolore magna\n aliqua. Ut enim ad minim veniam, quis nostrud exercitation\n ullamco laboris nisi ut aliquip ex ea commodo consequat.\n Duis aute irure dolor in reprehenderit in voluptate velit\n esse cillum dolore eu fugiat nulla pariatur. Excepteur sint\n occaecat cupidatat non proident, sunt in culpa qui officia\n deserunt mollit anim id est laborum.\n </p>\n ))}\n </div>\n <SheetFooter>\n <Button type=\"submit\">Save changes</Button>\n <SheetClose render={<Button variant=\"outline\" />}>\n Cancel\n </SheetClose>\n </SheetFooter>\n </SheetContent>\n </Sheet>\n ))}\n </div>\n </Example>\n )\n}\n",
"type": "registry:example"
}
],
"type": "registry:example"
}