Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Collapsible

    One region that opens and closes under its trigger. Where Accordion manages a set of items, Collapsible is the single building block: a "show more", a file tree, an advanced section.

    Install

    npx shadcn@latest add @nelumbo/collapsible

    Show more

    The chevron prop adds a trailing chevron that turns on a spring. The extra rows grow in with a height animation and a fade.

    Reviewers

    • Maya KowalskiApproved
    • Kenji WatanabeRequested changes
    • Léa MartinApproved

    Repository files

    Nest them: each folder is a Collapsible, and CollapsibleChevron takes any glyph and any rotation.

      • app.tsx
    • package.json

    With a button

    Use asChild to make any Nelumbo button the trigger and drop CollapsibleChevron inside it.

    Usage

    import { Collapsible, CollapsibleTrigger, CollapsibleContent, CollapsibleChevron } from "@/components/ui/collapsible"​<Collapsible>  <CollapsibleTrigger chevron>Show 3 more</CollapsibleTrigger>  <CollapsibleContent>…</CollapsibleContent></Collapsible>​<Collapsible>  <CollapsibleTrigger asChild>    <Button variant="secondary">Advanced <CollapsibleChevron /></Button>  </CollapsibleTrigger>  <CollapsibleContent>…</CollapsibleContent></Collapsible>

    Props

    Other props go to Radix Collapsible (open, defaultOpen, onOpenChange, disabled). Enter and Space toggle.

    PropTypeDefaultNotes
    CollapsibleTrigger chevronboolean | IconNamefalseTrailing chevron that turns when open (not with asChild)
    CollapsibleChevron nameIconName"keyboard_arrow_down"Rotates 180 degrees on a spring; override with a className for other turns