Skip to main content

Types Reference

CardProps

Props passed to custom card render functions (renderCard on TourProvider, renderCustomCard on TourZone).

interface CardProps {
step: TourStep;
currentStepIndex: number;
totalSteps: number;
next: () => void;
prev: () => void;
stop: () => void;
isFirst: boolean;
isLast: boolean;
labels?: TourLabels;
required?: boolean; // If true, the skip button should be hidden
completed?: boolean; // If false, the next button should be disabled
}
FieldTypeDescription
stepTourStepThe current step's data (key, name, description).
currentStepIndexnumberZero-based index of the current step.
totalStepsnumberTotal number of steps in the tour.
next() => voidAdvance to the next step.
prev() => voidGo back to the previous step.
stop() => voidStop/close the tour.
isFirstbooleanWhether the current step is the first step.
isLastbooleanWhether the current step is the last step.
labelsTourLabelsButton label overrides from config.labels.
requiredbooleanWhether the skip button should be hidden.
completedbooleanWhether the next button is enabled (false = disabled).

TourPersistenceConfig

Configuration for the persistence (resume) feature.

interface TourPersistenceConfig {
enabled: boolean;
tourId: string;
autoResume?: boolean;
clearOnComplete?: boolean;
maxAge?: number;
storage?: StorageAdapter;
}
FieldTypeDefaultDescription
enabledbooleanEnables persistence.
tourIdstringUnique identifier for this tour's saved state.
autoResumebooleantrueAutomatically resume from the last saved step when start() is called.
clearOnCompletebooleantrueClear saved progress when the tour completes.
maxAgenumberundefinedMilliseconds before saved progress expires.
storageStorageAdapterundefinedCustom storage adapter (defaults to MMKV v4 or AsyncStorage).

StorageAdapter

Interface for providing a custom storage backend.

interface StorageAdapter {
getItem: (key: string) => string | null | Promise<string | null>;
setItem: (key: string, value: string) => void | Promise<void>;
removeItem: (key: string) => void | Promise<void>;
}

TourLabels

Custom labels for the tour navigation buttons.

interface TourLabels {
next?: string;
previous?: string;
finish?: string;
skip?: string;
}