Skip to main content

TourProvider

The main context provider that powers the tour. Place it at the root of your application (or your tour-scoped component tree).

import { TourProvider } from 'react-native-lumen';

<TourProvider stepsOrder={['step1', 'step2']} config={{ enableGlow: true }}>
<App />
</TourProvider>;

Props

PropTypeDefaultDescription
childrenReact.ReactNodeRequiredApplication content.
stepsOrderstring[] | Record<string, string[]>undefinedStep ordering. Flat array or screen-grouped object.
backdropOpacitynumber0.5Opacity of the dark background overlay (0–1).
configTourConfigundefinedGlobal configuration options.

TourConfig

The config prop accepts a TourConfig object with the following fields:

interface TourConfig {
springConfig?: WithSpringConfig;
preventInteraction?: boolean;
labels?: {
next?: string;
previous?: string;
finish?: string;
skip?: string;
};
renderCard?: (props: CardProps) => React.ReactNode;
backdropOpacity?: number;
zoneStyle?: ZoneStyle;
persistence?: TourPersistenceConfig;
enableGlow?: boolean;
tooltipStyles?: TooltipStyles;
}
FieldTypeDefaultDescription
springConfigWithSpringConfigundefinedReanimated spring config for zone animations. Use presets like SnappySpringConfig.
preventInteractionbooleanfalseIf true, blocks interaction with the app while the tour is active.
labelsobjectundefinedCustom labels for the Next, Previous, Finish, and Skip buttons.
renderCard(props: CardProps) => ReactNodeundefinedFully custom tooltip renderer applied to all steps.
backdropOpacitynumber0.5Opacity of the overlay backdrop.
zoneStyleZoneStyleundefinedGlobal zone styling defaults (overridable per step).
persistenceTourPersistenceConfigundefinedConfiguration for saving and resuming tour progress.
enableGlowbooleanfalseEnables the glow effect around highlighted zones.
tooltipStylesTooltipStylesundefinedCustom styles for the default tooltip card.

Animation Presets

React Native Lumen ships with built-in Reanimated spring configs:

PresetDescription
Reanimated3DefaultSpringConfigDefault Reanimated 3 spring
WigglySpringConfigBouncy, playful feel
GentleSpringConfigSmooth, slow transitions
SnappySpringConfigFast and responsive
import { TourProvider, SnappySpringConfig } from 'react-native-lumen';

<TourProvider config={{ springConfig: SnappySpringConfig }}>...</TourProvider>;