Collapsible

A flexible collapsible section for showing and hiding content.

import { Collapsible } from '@cerberus-design/react'

Usage

The Collapsible component allows you to show or hide content with a trigger. It is useful for accordions, dropdowns, and expandable sections.

Effects

To turn off the animation effect, you can set the effect prop to none on the Collapsible.Content component.

Primitives

You can utilize the primitive components to build a custom collapsible solution.

ComponentDescription
CollapsibleRootThe context provider of the collapsible.
CollapsibleTriggerThe button that toggles the collapsible.
CollapsibleIndicatorThe indicator that shows the state.
CollapsibleContentThe content of the collapsible.

Primitive Selectors

Each primitive component has a data attribute for easy targeting.

NameValueDescription
data-scopecollapsibleThe scope of the components.
data-partrootThe root container part.
data-parttriggerThe trigger part.
data-partindicatorThe indicator part.
data-partcontentThe content part.

API

Collapsible

The Collapsible component is an Object containing all the primitive components.

You can see additional options for the Root component.

Parts

The CollapsibleParts API is the same as the Collapsible component.