Components

Collapsible

An interactive component that expands and collapses a panel of content.

@mijn-ui starred 3 repositories
@mijn-ui/react

Installation

npm install @mijn-ui/react-collapsible
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@mijn-ui/react-collapsible"
<Collapsible>
  <CollapsibleTrigger>Toggle</CollapsibleTrigger>
  <CollapsibleContent>Collapsible content</CollapsibleContent>
</Collapsible>

API Reference

Collapsible is a thin wrapper around Radix UI Collapsible, so all of its props are forwarded to the underlying primitives.

PropTypeDefaultDescription
defaultOpenbooleanfalseThe open state of the collapsible when initially rendered.
openbooleanThe controlled open state.
onOpenChange(open: boolean) => voidEvent handler called when the open state changes.
disabledbooleanfalseWhen true, prevents the user from interacting.
classNamestringAdditional classes for the component.

See the Radix Collapsible API for the full prop list of each part.