Skip to main content

API

Cicerone

A namespace so call sites read as <Cicerone.Target>. Each member is also exported on its own if you prefer that.

MemberAlso exported as
Cicerone.ProviderCiceroneProvider
Cicerone.TargetTarget
Cicerone.ScrollViewCiceroneScrollView

Cicerone.Provider

PropTypeDefaultWhat it does
stepsICiceroneStep[]noneThe tour, in order
autoStartbooleantrueStart on its own; flip it true later to start
startDelaynumber800Wait before auto-start, to let the screen settle
themeICiceroneThemeOverrideshipped paletteColours, merged field by field
labelsPartial<ICiceroneLabels>EnglishButton and counter text
overlayPress'next' | 'skip' | 'none''next'What a press outside the target does
allowTargetInteractionbooleanfalseLet presses reach the highlighted element
renderCard(props: ICiceroneCardProps) => ReactNodebuilt-in cardReplace the card
renderBackdrop(props) => ReactNodenoneDraw inside the cut-out, e.g. a blur
cardWidthnumber284Card width
cardStyleStyleProp<ViewStyle>noneExtra style on the default card
onStart() => voidnoneThe tour began
onStepChange(index: number, step: ICiceroneStep) => voidnoneA step became active
onStop(reason: 'finished' | 'skipped' | 'manual') => voidnoneThe tour ended

Cicerone.Target

PropTypeWhat it does
idstringMatches a step's id
childrenReactNodeThe element to highlight
styleStyleProp<ViewStyle>Applied to the wrapper, see Targets

Cicerone.ScrollView

Takes every ScrollView prop. Your onScroll and onContentSizeChange still fire, the component just listens in as well.

ICiceroneStep

FieldTypeDefaultWhat it does
idstringnoneMatches a Target
titlestringnoneCard heading
textstringnoneCard body
paddingnumber8Gap between target and ring
radiusnumber | 'circle'0Corner radius of the target
variant'default' | 'highlight''default'Which palette to use
labelstringnoneReplaces the step counter
placement'top' | 'bottom'autoForces the card side
before() => void | Promise<void>noneRuns before measuring
beforeDelaynumbernoneWait after before

useCicerone()

Throws if you call it outside a provider. The message names the provider, so you do not end up chasing an undefined three frames later.

FieldTypeWhat it is
isRunningbooleanA step is on screen
stepICiceroneStep | nullThe active step
indexnumberZero-based position
totalnumberHow many steps
isFirst / isLastbooleanWhere in the tour
start() => voidBegin the tour
stop() => voidEnd it
next / previous() => voidMove a step
skip() => voidEnd it, reported as skipped
goTo(index: number) => voidJump; out-of-range is ignored

ICiceroneCardProps

What renderCard receives.

FieldType
stepICiceroneStep
index / totalnumber
isFirst / isLastboolean
placement'top' | 'bottom'
paletteICiceroneCardPalette
labelsICiceroneLabels
next / previous / skip / stop() => void