Accordion
Pre-alphaThe registry and the CLI are not published yet.Roadmap

Accordion

Collapsible sections.

Help

Frequently asked

How long does shipping take?

Orders ship within 2 business days. Delivery takes 3–5 days in Europe and 5–8 days elsewhere. You’ll get a tracking link by email.

Can I return an item?

Do you ship internationally?

Gift cards

Soon

Installation

npx axiom add accordion
pnpm dlx axiom add accordion
yarn dlx axiom add accordion
bun x axiom add accordion

Installs: react-native-reanimated, react-native-worklets.

Requires the chevron-down icon in your icon registry. Open sections, measuring and the height animation live in use-accordion.ts, shared by every styling variant.

Usage

import { Accordion } from "@/components/ui/accordion";

<Accordion type="single" collapsible>
	<Accordion.Item value="shipping">
		<Accordion.Trigger>Shipping</Accordion.Trigger>
		<Accordion.Content>Orders ship within 2 days.</Accordion.Content>
	</Accordion.Item>
</Accordion>;

Props

Accordion

PropTypeDefaultDescription
type'single' | 'multiple''single'single: opening a section closes the others. multiple: several sections can stay open.
valuestring | string[]Open section(s): a string for single, an array for multiple.
defaultValuestring | string[]Initially open section(s) when the accordion manages its own state.
onValueChange(value) => voidCalled when a section opens or closes.
collapsiblebooleantrueWith type="single", lets the user close the open section. false always keeps one open.
disabledbooleanfalseDisables every section.
dividerbooleantrueHairline between sections.
childrenReactNodeAccordion.Item elements.
styleStyleProp<ViewStyle>Extra styles.

Accordion.Item

PropTypeDefaultDescription
valuestringRequired. Identifies the section.
disabledbooleanfalseKeeps this section closed and dims its trigger.
styleStyleProp<ViewStyle>Extra styles.

Accordion.Trigger

PropTypeDefaultDescription
childrenReactNodeThe section title.
iconReactNode | nullchevronIndicator on the right, rotated when open. null hides it.
leadingReactNodeContent before the title, such as an icon.
styleStyleProp<ViewStyle>Extra styles.

The trigger sets accessibilityRole="button" and accessibilityState.expanded.

Accordion.Content

PropTypeDefaultDescription
childrenReactNodeThe section body. It is measured once, then its height animates on the UI thread.
forceMountbooleanfalseKeeps the content mounted while closed, to preserve its state (a form, a video position).
styleStyleProp<ViewStyle>Extra styles.

Use cases

FAQ

type="single" so the screen doesn’t turn into a wall of open answers.

What is Axiom?

Is it free?

Yes. The code is copied into your project and you own it. There is no runtime package to pay for.

Does it work with Expo?

<Accordion type="single" collapsible>
	{faq.map((q) => (
		<Accordion.Item key={q.id} value={q.id}>
			<Accordion.Trigger>{q.question}</Accordion.Trigger>
			<Accordion.Content>
				<Text color="muted">{q.answer}</Text>
			</Accordion.Content>
		</Accordion.Item>
	))}
</Accordion>

Order details

type="multiple" for sections the user compares, with a summary in the trigger.

Order #10482

3 items

$88.90

Canvas tote × 1$32.00
Cold brew × 2$9.00
Notebook × 1$43.00

Delivery

Tomorrow

221B Baker Street, London NW1 6XE

<Accordion type="multiple" defaultValue={["items"]}>
	<Accordion.Item value="items">
		<Accordion.Trigger leading={<Icon name="bag" />}>
			3 items
		</Accordion.Trigger>
		<Accordion.Content>{/* lines */}</Accordion.Content>
	</Accordion.Item>
	<Accordion.Item value="delivery">…</Accordion.Item>
</Accordion>

Advanced options in a form

Keep rare settings out of the way. forceMount keeps what the user typed if they close the section.

Project name
axiom-demo

Advanced

New Architecture

Bundle identifier
dev.axiom.demo

Create project

<Accordion type="single" collapsible>
  <Accordion.Item value="advanced">
    <Accordion.Trigger>Advanced</Accordion.Trigger>
    <Accordion.Content forceMount>
      <Switch />
      <Input label="Bundle identifier" />
    </Accordion.Content>
  </Accordion.Item>
</Accordion>