Accordion
Expandable sections for FAQs and grouped settings.
Code
import * as React from 'react';
import { Accordion } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 460,
}}
>
<Accordion
defaultValue={['0']}
items={[
{
title: 'What’s included in the free plan?',
content: 'Up to 3 projects and 5 collaborators.',
},
{
title: 'Can I change plans later?',
content: 'Yes, any time from Settings.',
},
{
title: 'How do refunds work?',
content: 'Contact support within 14 days.',
},
]}
/>
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { Accordion } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/accordion.jsonGuidelines
multipleallows several open.
Props
| Prop | Type | Required |
|---|---|---|
items | Array<{ value?: string; title: React.ReactNode; content: React.ReactNode }> | Yes |
value | string[] | No |
defaultValue | string[] | No |
onChange | (open: string[]) => void | No |
multiple | boolean | No |
className | string | No |