Collapsible

Tabs display different sections of content, with only one panel visible at once.

@radix-ui/react-collapsible

lucide-react

Installation


1

Install the following dependencies:

npx shadcn@latest add https://sbthemes.com/r/collapsible.json

API Reference

Root

Root component that controls all the parts of a tabs.

PropTypeDefault
asChildbooleanfalse
defaultOpenboolean-
openboolean-
onValueChangefunction-
disabledboolean-
Data attributeValues
[data-state]open, close
[data-disabled]Present when disabled

Trigger

The button that activates its associated content.

PropTypeDefault
asChildbooleanfalse
Data attributeValues
[data-state]open, close
[data-disabled]Present when disabled

Content

The component that contains the collapsible content.

PropTypeDefault
asChildbooleanfalse
Data attributeValues
[data-state]open, close
[data-disabled]Present when disabled