Skip to content
Native Animation
Base Onboarding Block animation previewBase Onboarding Block animation preview

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

npx nativeanimation add base-onboarding-block
Onboarding

Base Onboarding Block

React Native Onboarding Block

A three-step onboarding screen with configurable goals, interests, daily preferences, copy, answers, step control, callbacks, insets, and theme.

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

A three-step onboarding screen with configurable goals, interests, daily preferences, copy, answers, step control, callbacks, insets, and theme.

How it works

  1. Composes a progress bar, radio goals, multiple interest chips, a daily-goal slider, a reminder switch, and navigation buttons.
  2. Sections reveal in 300 ms with 30 ms staggering and a 6 pt offset. Step content exits in 150 ms with panelOut and enters in 300 ms with panelIn, traveling 24 pt horizontally in the direction of navigation.
  3. An exit generation token and canceled animations prevent stale callbacks from replacing a newer requested step. Content and the incoming pose commit together.
  4. Answers live outside the step panel, so Back and Next preserve all values. Skip and completion receive the complete current answers.
  5. The host owns navigation after skip/completion and applies or persists the received preferences. Loading replaces the step content with skeletons and blocks navigation.

Install

npx nativeanimation add base-onboarding-block

The CLI copies the exact family modules listed in registryDependencies, including their transitive dependencies. To copy by hand, copy those modules too and install their native packages with:

npx expo install react-native-gesture-handler react-native-reanimated react-native-worklets lucide-react-native react-native-svg

Mount GestureHandlerRootView at the app root. Load the Geist regular and medium fonts once, or supply your own font names through the theme. Free forever. MIT.

Usage

import { BaseOnboardingBlock } from './base-onboarding-block';

<BaseOnboardingBlock
  values={answers}
  onValuesChange={setAnswers}
  onComplete={createWorkspace}
  onSkip={continueWithDefaults}
  insets={insets}
/>

Wrap your app in BaseThemeProvider from base-theme to choose light/dark and neutral, blue, green, or violet accents. A theme prop overrides the provider and is inherited by nested controls, sheets, and dialogs. Place the block inside a bounded container with flex: 1; screens scroll vertically when space is limited. Supply safe-area insets from the host.

OnboardingValues contains goal, interests, minutes, and reminders. Supply values with onValuesChange for controlled answers, or defaultValues for local state. step and onStepChange are independently controllable. Copy templates use {current}, {total}, and {minutes}.

Use with an agent

Use Native Animation MCP to add base-onboarding-block with three steps for a goal, multiple interests, and daily preferences.

Props

PropTypeDefaultDescription
copyPartial<copy>Northwind copyAll titles, descriptions, labels, and templates.
goalsBaseRadioOption[]organize, learn, teamGoal value, label, optional description/disabled.
interestsBaseToggleItem[]six interest chipsInterest value, label, optional icon/disabled.
values / defaultValuesOnboardingValues / Partial<OnboardingValues>first goal, [], 15 minutes, reminders=trueControlled or initial answers.
onValuesChange(values: OnboardingValues) => void—Receives goal, interests, minutes, and reminders.
step / defaultStepnumber0Controlled or initial zero-based step, clamped to 0–2.
onStepChange(step: number) => void—Receives requested step navigation.
onComplete / onSkip(values: OnboardingValues) => void—Receives all answers without clearing them.
minuteRange{ min: number; max: number; step: number }5 / 60 / 5Slider bounds and increment.
insets{ top?: number; bottom?: number }0 / 0Host safe-area insets; no internal SafeAreaView.
themeBaseThemenearest providerFull shared theme override inherited by every nested control.
onBack / backLabel() => void / string— / BackOptional host back action and its accessible name.
loading / errorboolean / stringfalse / —Host pending state and failure message.
testIDstringpiece IDStable identifier on the screen primary action.
styleStyleProp<ViewStyle>flex: 1Container override.

copy supports these keys: title, progress, step, goalTitle, goalDescription, interestsTitle, interestsDescription, interestsLabel, preferencesTitle, preferencesDescription, minutes, slider, notifications, reminderDescription, back, next, finish, skip, errorTitle. Unspecified keys keep the generic English defaults. Icons and content remain caller-owned.

Compatibility

Expo SDK 58 · React Native 0.88 · Reanimated 4.7 · react-native-worklets 0.13. Targets iOS, Android, and web, in Expo Go and development builds. Native bundle compilation does not replace device interaction testing. Part of Native Animation Base. Free forever. MIT. No router, network, or storage dependency.

Go further

Accessibility

The progress bar exposes its current value; radios, chips, slider, and switch keep their native accessibility semantics. Next requires a goal on step one. The loading region announces busy state and errors use an alert. Reduced motion removes both reveal displacement and horizontal step transitions.

Source code

Loading public source…