Files
shadcn-ui/apps/v4/public/r/styles/base-nova/carousel-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

18 lines
3.5 KiB
JSON

{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "carousel-example",
"title": "Carousel",
"registryDependencies": [
"card",
"carousel",
"example"
],
"files": [
{
"path": "registry/base-nova/examples/carousel-example.tsx",
"content": "import {\n Example,\n ExampleWrapper,\n} from \"@/registry/base-nova/components/example\"\nimport { Card, CardContent } from \"@/registry/base-nova/ui/card\"\nimport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n} from \"@/registry/base-nova/ui/carousel\"\n\nexport default function CarouselExample() {\n return (\n <ExampleWrapper className=\"lg:grid-cols-1\">\n <CarouselBasic />\n <CarouselMultiple />\n <CarouselWithGap />\n </ExampleWrapper>\n )\n}\n\nfunction CarouselBasic() {\n return (\n <Example title=\"Basic\">\n <Carousel className=\"mx-auto max-w-xs sm:max-w-sm\">\n <CarouselContent>\n {Array.from({ length: 5 }).map((_, index) => (\n <CarouselItem key={index}>\n <div className=\"p-1\">\n <Card>\n <CardContent className=\"flex aspect-square items-center justify-center p-6\">\n <span className=\"text-4xl font-semibold\">{index + 1}</span>\n </CardContent>\n </Card>\n </div>\n </CarouselItem>\n ))}\n </CarouselContent>\n <CarouselPrevious className=\"hidden sm:inline-flex\" />\n <CarouselNext className=\"hidden sm:inline-flex\" />\n </Carousel>\n </Example>\n )\n}\n\nfunction CarouselMultiple() {\n return (\n <Example title=\"Multiple\">\n <Carousel\n className=\"mx-auto max-w-xs sm:max-w-sm\"\n opts={{\n align: \"start\",\n }}\n >\n <CarouselContent>\n {Array.from({ length: 5 }).map((_, index) => (\n <CarouselItem key={index} className=\"sm:basis-1/2 lg:basis-1/3\">\n <div className=\"p-1\">\n <Card>\n <CardContent className=\"flex aspect-square items-center justify-center p-6\">\n <span className=\"text-3xl font-semibold\">{index + 1}</span>\n </CardContent>\n </Card>\n </div>\n </CarouselItem>\n ))}\n </CarouselContent>\n <CarouselPrevious className=\"hidden sm:inline-flex\" />\n <CarouselNext className=\"hidden sm:inline-flex\" />\n </Carousel>\n </Example>\n )\n}\n\nfunction CarouselWithGap() {\n return (\n <Example title=\"With Gap\">\n <Carousel className=\"mx-auto max-w-xs sm:max-w-sm\">\n <CarouselContent className=\"-ml-1\">\n {Array.from({ length: 5 }).map((_, index) => (\n <CarouselItem key={index} className=\"pl-1 md:basis-1/2\">\n <div className=\"p-1\">\n <Card>\n <CardContent className=\"flex aspect-square items-center justify-center p-6\">\n <span className=\"text-2xl font-semibold\">{index + 1}</span>\n </CardContent>\n </Card>\n </div>\n </CarouselItem>\n ))}\n </CarouselContent>\n <CarouselPrevious className=\"hidden sm:inline-flex\" />\n <CarouselNext className=\"hidden sm:inline-flex\" />\n </Carousel>\n </Example>\n )\n}\n",
"type": "registry:example"
}
],
"type": "registry:example"
}