Skip to content
Native Animation
Base Accordion animation previewBase Accordion animation preview

This preview uses fictional demo content. See the props below for the customization options available in this component.

npx nativeanimation add base-accordion

Base Accordion

React Native Accordion Component

Measured disclosure rows that open smoothly without guessing their content height.

Native Animation Base · Free · MIT

Add to your project

Copy the component and its assets into your app with the Native Animation CLI, or paste the agent prompt into Claude Code, Codex or Cursor once the MCP server is connected.

About this component

Related guides

Measured disclosure rows that open smoothly without guessing their content height.

How it works

  1. Each item measures a hidden copy of its content with onLayout.
  2. The visible copy animates from zero to the measured height over 350ms.
  3. Opacity and the chevron rotation follow the same progress value.
  4. Single mode closes the previous item as the next one opens; multiple mode keeps any set open.

Install

npx nativeanimation add base-accordion
npx expo install lucide-react-native react-native-gesture-handler react-native-reanimated react-native-worklets

Usage

<BaseAccordion items={items} type="single" value={open} onValueChange={setOpen} />
<BaseAccordion items={items} type="multiple" collapsible />

Props

PropTypeDefaultDescription
itemsBaseAccordionItem[]requiredValues, titles, and React content.
type'single' | 'multiple'singleAllow one or many open items.
valuestring | string[]—Controlled open value(s).
onValueChange(value: string | string[]) => void—Called when disclosure changes.
collapsiblebooleantrueAllows the open single item to close.
themeBaseThemeproviderOverrides the family theme.
testIDstring—Stable root identifier.

Compatibility

Expo SDK 58 · React Native 0.88 · Reanimated 4.7 · react-native-worklets 0.13. Runs on iOS, Android, and web in Expo Go or a development build.

Accessibility

Each trigger is a button with an expanded state and a readable title. Reduced motion changes disclosure height and opacity immediately.

Source code

Loading public source…