Both axes
Vertical for accordions and disclosure panels, horizontal for sidebars and drawers. Same component, one direction prop.
Horizontal collapse →An animated collapsible built on CSS Grid transitions. No height measuring, no animation loops — the browser does the motion, React flips a boolean. Two axes, two hide modes, accessibility wired in.
$bun add @westopp/react-collapsibleVertical for accordions and disclosure panels, horizontal for sidebars and drawers. Same component, one direction prop.
Horizontal collapse →Prefix any class with open: or closed: and it applies only in that state. Cross-fade opacity, swap borders, rotate chevrons — without wiring state into your CSS.
Conditional classes →Built around the aria-controls / aria-expanded contract, with aria-hidden managed for you and a dev-mode warning when the trigger wiring is missing.
Accessibility →A walkthrough from install to an animated, accessible disclosure panel.