Kinetik UI

Fold Panel

.md

A panel that unfolds in place: the body springs to its measured height and drifts in behind it.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add fold-panel

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/fold-panel.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/fold-panel.tsx
    View source files

Usage

import { FoldPanel } from '@/components/kinetik/fold-panel';

<FoldPanel title="Check-in" subtitle="Friday from 3 pm" leading={<CalendarIcon />}>
  <Text>Self check-in with a lockbox. The code arrives the day before.</Text>
</FoldPanel>;

For a group where only one panel is open at a time, hold the open one in state:

const [open, setOpen] = useState<string | null>('check-in');

<FoldPanel
  title="Check-in"
  open={open === 'check-in'}
  onOpenChange={(o) => setOpen(o ? 'check-in' : null)}
>
  …
</FoldPanel>;

When to use

  • Details that most people skip but some need: policies, specifications, frequently asked questions.
  • Long settings or booking screens, to keep the overview short.

When not to use

  • The main content of a screen. Hiding it behind a tap slows everyone down.
  • Content that changes height constantly while open, such as a live feed. Measure-and-spring suits settled content.

Notes

  • The body is measured at its natural height, so it can hold anything: text, images, lists.
  • The panel lifts from surface to surfaceRaised as it opens, so an open panel reads as the one in focus.
  • With reduced motion the body appears at once.

Props

FoldPanelProps

PropTypeDefaultDescription
titlerequiredstring—
childrenrequiredReactNode—What unfolds. Any height; it is measured.
subtitlestring—A line under the title, visible while folded.
leadingReactNode—An icon before the title. It sits on a small tinted tile.
openboolean—Controlled state. Leave unset to let the panel keep its own.
defaultOpenbooleanfalse
onOpenChange(open: boolean) => void—
disabledbooleanfalse
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
One spring drives the height, the body, the chevron and the panel colour. The body is measured once per layout, not per frame.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.95× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 152 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
The body appears and disappears at once; the chevron flips without turning.
Screen readers
The header is a button with an expanded state; a folded body is hidden from screen readers.
Touch target
The header is at least 64 pt tall and full width.

Source files

components/kinetik/fold-panel.tsx is in the Code tab of the preview above.