snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
32
apps/v4/examples/base/collapsible-basic.tsx
Normal file
32
apps/v4/examples/base/collapsible-basic.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { ChevronDownIcon } from "@/registry/icons/__lucide__"
|
||||
import { Button } from "@/styles/base-nova/ui/button"
|
||||
import { Card, CardContent } from "@/styles/base-nova/ui/card"
|
||||
import {
|
||||
Collapsible,
|
||||
CollapsibleContent,
|
||||
CollapsibleTrigger,
|
||||
} from "@/styles/base-nova/ui/collapsible"
|
||||
|
||||
export function CollapsibleBasic() {
|
||||
return (
|
||||
<Card className="mx-auto w-full max-w-sm">
|
||||
<CardContent>
|
||||
<Collapsible className="rounded-md data-open:bg-muted">
|
||||
<CollapsibleTrigger
|
||||
render={<Button variant="ghost" className="w-full" />}
|
||||
>
|
||||
Product details
|
||||
<ChevronDownIcon className="ml-auto group-data-panel-open/button:rotate-180" />
|
||||
</CollapsibleTrigger>
|
||||
<CollapsibleContent className="flex flex-col items-start gap-2 p-2.5 pt-0 text-sm">
|
||||
<div>
|
||||
This panel can be expanded or collapsed to reveal additional
|
||||
content.
|
||||
</div>
|
||||
<Button size="xs">Learn More</Button>
|
||||
</CollapsibleContent>
|
||||
</Collapsible>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user