Accordion

Add Accordions to your documentation

it is an optional component which won't be loaded by default.

Usage

Wrap accordions in the container, a type property is required by default.

Based on Radix UI Accordion.

import { Accordion, Accordions } from 'next-docs-ui/components/accordion';
 
<Accordions>
<Accordion title="My Title">
 
My Content
 
</Accordion>
</Accordions>

Accordions

PropTypeDefault
type
single | multiple
single
collapsible
boolean
true

Accordion

PropTypeDefault
title
string
-
id
string
-
disabled
boolean
false

Linking to Accordion

You can specify an id for accordion. The accordion will automatically open when the user is navigating to the page with the specified id in hash parameter.

<Accordions>
<Accordion title="My Title" id="my-title">
 
My Content
 
</Accordion>
</Accordions>

Last updated on