Collapsible

A single expand/collapse section — the simpler primitive behind Accordion. The chevron rotates open with the same hand-drawn path.

A number that locks the wobble. Omit it and Shuffle redraws every line.
<Collapsible defaultOpen roughness={1.5}>
  <CollapsibleTrigger>What is a seed?</CollapsibleTrigger>
  <CollapsibleContent>A number that locks the wobble.</CollapsibleContent>
</Collapsible>

CLI install

npx doodleui-react add collapsible

Usage

import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "doodleui-react";

<Collapsible defaultOpen>
  <CollapsibleTrigger>What is a seed?</CollapsibleTrigger>
  <CollapsibleContent>
    A number that locks the wobble.
  </CollapsibleContent>
</Collapsible>

Reach for Accordion instead when you need multiple sections that share open/close behavior.

Props

PropTypeDefaultNotes
open / onOpenChangeboolean / (open: boolean) => voiduncontrolledRadix controlled API.
defaultOpenbooleanfalseInitial open state when uncontrolled.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.