Prodular UI

Collapsible

Shows and hides one section of content with a trigger, animating its height.

npx prodular-ui add collapsible

Show more

The first rows stay visible. The rest expand under them.

Environment variables

  • DATABASE_URLpostgres://halden-prod...
  • STRIPE_SECRET_KEYsk_live_...4Xq2

Disclosure

A chevron trigger that rotates when open, styled with group-data-panel-open.

Charged
$12,480.00 on Oct 18, 2026
Method
Visa ending 4242
Receipt
rcpt_8f3c21a9

Anatomy

<Collapsible>  <CollapsibleTrigger>Payment details</CollapsibleTrigger>  <CollapsibleContent>...</CollapsibleContent></Collapsible>

Guidance

Use it when

  • One optional section: advanced settings, more rows, payment details.
  • Building blocks for custom disclosures, such as a step in an agent trace.

Avoid

  • Several related sections. Use Accordion.
  • Hiding errors or required fields.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Render the trigger as a Button with render={<Button variant="ghost" size="icon-sm" aria-label="..." />} when it is icon only.
  • Rotate trigger chevrons with group-data-panel-open on the trigger, not with your own state.
  • Keep the content's layout the same as the visible part so it reads as a continuation.
  • Height animates automatically and respects reduced motion. Do not add your own transition.

API

Collapsible

PropTypeDefaultDescription
openbooleanControlled open state.
defaultOpenbooleanfalseUncontrolled initial state.
onOpenChange(open: boolean) => voidCalled when the trigger toggles.

CollapsibleTrigger

PropTypeDefaultDescription
renderReactElementRenders the trigger as another element, usually a Button.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add collapsible# or, with the registry in components.jsonnpx shadcn@latest add @prodular/collapsible