Skip to main content

Api

Props

PropertyTypeDefaultDescription
storiesIStoryObject[][]An array of story objects. description of IStoryObject is mentioned below
heightstring100%Height of story container
widthstring100%Width of story container
onStoryChangefunction(index:number)-Callback called when story changes
onStoriesStartfunction-Callback called when first story is rendered. it get called only once,
onAllStoriesEndfunction-Callback called when last story gets completed. it will get called only once
currentIndexnumber-Current index of the story which should be selected first
defaultDurationnumber10000default duration in ms of stories if duration is not provided in the IStoryObject
classNamesIStoryClassNames{}classnames to overide different sections of a story renderer
pauseStoryWhenInActiveWindowbooleantruepauses story when window goes out of focus (user changes tab/minimizes browser etc

IStoryObject

PropertyTypeDefaultDescription
typeimage , video , component-type of story to render
urlstring-url of a story (image & video only)
durationduration10000duration in ms of the story
componentReact Component-custom component to render as a story
headerReact Component-header of a story
seeMorestring , boolean , React ComponenttrueSee more action text
seeMoreComponentReact Component-see more component opens after clicking see more
onSeeMoreClickfunction(index:number)-Callback called when story see more is clicked

IStoryClassNames

PropertyTypeDefaultDescription
mainstring-classname for main container
progressContainerstring-classname for progress line container
progressBarContainerstring-classname for single progress bar box container
progressBarstring-classname for progress bar
storyContainerstring-classname for story container

Custom Component Story Props

PropertyTypeDescription
pausefunctioncall it to pause a story
resumefunctioncall it to resume a story
storyIStoryObjectcurrent story properties
isPausedbooleanstate of a story