Pho Design System

Collapsible

Shows or hides a single region of content with a smooth height animation. Built on Base UI Collapsible. For several sections where one expands at a time, reach for Accordion.

Import

import { Collapsible } from "@photon-ai/pho-ui/components/collapsible";

Basic

Collapsible.Trigger toggles Collapsible.Panel. Any <svg> in the trigger rotates when open. Left uncontrolled, the panel starts closed unless you pass defaultOpen.

Deployed photon-web to production · 2h ago

Merged #482 “Fix avatar fallback” · 5h ago

Opened #486 “Add Slider component” · 6h ago

import { IconChevronDown } from "@tabler/icons-react";

<Collapsible.Root defaultOpen>
  <Collapsible.Trigger>
    Recent activity
    <IconChevronDown />
  </Collapsible.Trigger>
  <Collapsible.Panel>
    <div className="pt-3">…</div>
  </Collapsible.Panel>
</Collapsible.Root>;

Controlled

Drive the open state yourself with open + onOpenChange when another control needs to read or set it. Omit both to stay uncontrolled and let the trigger manage it.

Panel is closed.

const [open, setOpen] = useState(false);

<Collapsible.Root open={open} onOpenChange={setOpen}>
  <Collapsible.Trigger>
    Environment variables
    <IconChevronDown />
  </Collapsible.Trigger>
  <Collapsible.Panel>
    <div className="pt-3">…</div>
  </Collapsible.Panel>
</Collapsible.Root>;

Anatomy

Props

All three parts also forward className and their native element attributes.

Accessibility

Keyboard:

Best practices