Skip to main content

API Reference

Component Props

PropTypeDefaultDescription
childrenReact.ReactNode[]Optional child components
nextLabelstring | React.ReactNodeCustom "Next" button label
skipLabelstring | React.ReactNodeCustom "Skip" button label
doneLabelstring | React.ReactNodeCustom "Done" button label
showSkipbooleanfalseShow/hide skip button
showNextbooleantrueShow/hide next button
showDonebooleantrueShow/hide done button
scrollAnimationDurationnumber500Animation duration
useNativeDriverbooleanUse native driver
onDone() => voidDone callback
onSkip() => voidSkip callback
showPaginationbooleantrueShow/hide pagination
scrollEnabledbooleantrueEnable scrolling
paginationPosition'top' | 'bottom'Pagination position
widthnumberCustom width
colorstringPagination color
pagesPage[]Array of pages
swapbooleanfalseSwap layout

Page Interface

interface Page {
title: string;
subtitle: string;
image: React.ReactNode;
backgroundColor: string;
color?: string;
width?: number;
containerStyle?: StyleProp<ViewStyle>;
imageContainerStyle?: StyleProp<ViewStyle>;
titleContainerStyle?: StyleProp<ViewStyle>;
titleStyle?: StyleProp<TextStyle>;
subtitleStyle?: StyleProp<TextStyle>;
}

Style Props

PropTypeDescription
paginationContainerStyleStyleProp<ViewStyle>Pagination container style
buttonRightContainerStyleStyleProp<ViewStyle>Right button container
buttonLeftContainerStyleStyleProp<ViewStyle>Left button container
dotsContainerStyleStyleProp<ViewStyle>Dots container style
doneLabelStyleStyleProp<TextStyle>Done button text style
skipLabelStyleStyleProp<TextStyle>Skip button text style
nextLabelStyleStyleProp<TextStyle>Next button text style
containerStyleStyleProp<ViewStyle>Main container style

Hook API

useOnboarding

interface OnboardingHook {
currentPage: number;
setCurrentPage: (page: number) => void;
scrollEnabled: boolean;
enableScroll: (enabled: boolean) => void;
flatListRef: React.RefObject<FlatList>;
numberOfScreens: number;
nextPage: () => void;
scrollTo: (page: number) => void;
progress: number;
isDone: boolean;
}