Collapsible
Single show/hide section.
Code
import * as React from 'react';
import { Collapsible } from '@fruit-labs/design';
export default function Demo() {
return (
<div
style={{
maxWidth: 380,
}}
>
<Collapsible title="Advanced settings" defaultOpen>
Webhooks, API keys and data retention.
</Collapsible>
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { Collapsible } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/collapsible.jsonGuidelines
- For many sections use Accordion.
Props
| Prop | Type | Required |
|---|---|---|
title | React.ReactNode | Yes |
open | boolean | No |
defaultOpen | boolean | No |
onOpenChange | (open: boolean) => void | No |
className | string | No |
children | React.ReactNode | No |