mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-09 06:55:07 +00:00
40 lines
980 B
TypeScript
40 lines
980 B
TypeScript
import {
|
|
Accordion,
|
|
AccordionContent,
|
|
AccordionItem,
|
|
AccordionTrigger,
|
|
} from "@/examples/base/ui/accordion"
|
|
|
|
export function AccordionBasic() {
|
|
const items = [
|
|
{
|
|
value: "item-1",
|
|
trigger: "Is it accessible?",
|
|
content: "Yes. It adheres to the WAI-ARIA design pattern.",
|
|
},
|
|
{
|
|
value: "item-2",
|
|
trigger: "Is it styled?",
|
|
content:
|
|
"Yes. It comes with default styles that matches the other components' aesthetic.",
|
|
},
|
|
{
|
|
value: "item-3",
|
|
trigger: "Is it animated?",
|
|
content:
|
|
"Yes. It's animated by default, but you can disable it if you prefer.",
|
|
},
|
|
]
|
|
|
|
return (
|
|
<Accordion className="mx-auto max-w-lg">
|
|
{items.map((item) => (
|
|
<AccordionItem key={item.value} value={item.value}>
|
|
<AccordionTrigger>{item.trigger}</AccordionTrigger>
|
|
<AccordionContent>{item.content}</AccordionContent>
|
|
</AccordionItem>
|
|
))}
|
|
</Accordion>
|
|
)
|
|
}
|