Zephora UI

Navigation

Collapsible

Simple show/hide disclosure: a trigger button toggles the visibility of its content region.

Import

import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@zephora/react";

Examples

Basic

  • Added dark mode
  • Fixed focus ring on Safari

Controlled

Control the open state with `open` + `onOpenChange`.

API

Collapsible props

PropTypeDefaultDescription
openbooleanControlled open state.
defaultOpenbooleanfalseInitial open state (uncontrolled).
onOpenChange(open: boolean) => voidCalled when the open state changes.
disabledbooleanfalseDisables the trigger (inherited by CollapsibleTrigger).
unstyledbooleanfalseHeadless mode — inherited by all parts.

CollapsibleTrigger props

PropTypeDefaultDescription
disabledbooleanOverrides the disabled state inherited from the root.
…restButtonHTMLAttributes<HTMLButtonElement>All native button props are forwarded.

CollapsibleContent props

PropTypeDefaultDescription
…restHTMLAttributes<HTMLDivElement>All native div props are forwarded; hidden while closed.

Keyboard

KeyAction
Enter / SpaceToggles the disclosure from the trigger.