Accordion

Headless accordion primitives for Roblox UI with single and multiple disclosure modes.

Stable direction
@lattice-ui/accordion

Part of the stable direction toward v1.0.

What It Is For

Use Accordion when the screen needs progressive disclosure without leaving the current layout.

It is a headless compound component, so you own the trigger visuals, spacing, and motion while the package owns open-state coordination.

Preview size

Live demo is experimental and may contain bugs.

Install

Global CLI command: lattice add accordion

Monorepo local script

Use your package manager wrapper when running the local lattice command.

pnpm lattice add accordion

npm package: @lattice-ui/accordion

Peer dependencies

  • @rbxts/react
  • @rbxts/react-roblox

Public Exports

  • Accordion
  • Accordion.Root
  • Accordion.Item
  • Accordion.Header
  • Accordion.Trigger
  • Accordion.Content
  • nextAccordionValues
  • normalizeAccordionValue

State Model

  • Accordion.Root can be controlled with value or uncontrolled with defaultValue.
  • type switches the value shape between a single string and an array of strings.
  • Each item tracks open and disabled state through context, and Accordion.Content can stay mounted with forceMount.

Key API

Accordion.Root

Use type, value, defaultValue, onValueChange, and collapsible to define the disclosure model for the entire group.

Accordion.Item

Each item needs a stable value; disabled removes that item from interaction without changing the rest of the group.

Accordion.Content

Use forceMount when you need persistent layout measurement or your own enter/exit animation handling.

Composition Patterns

FAQ or help content

Model each answer as an Accordion.Item so the surrounding layout stays simple and only the disclosure behavior is shared.

Settings sections

Use type="single" when the UI should encourage one open section at a time, and type="multiple" for checklist-style review flows.

Cautions / Limits

  • Match the controlled value shape to type: a single string for single, an array for multiple.
  • The package does not style or animate panels for you; provide your own trigger affordance and content transition treatment.