1.0.3 • Published 1 year ago

react-stories-components v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

This project is a fork from mohitk05's stories, and it was only created to implement the functionality of clickable components.

Please keep updated on the original one.

Install

npm install --save react-stories-components

Demo

The component responds to actions like tap on right side for next story, on left for previous and tap and hold for pause. Custom time duration for each story can be provided.

clickable doesn't respond to actions like a tap on the right-left side for the next-previous story. Therefore you should useNavigationBar: true to enable it.

See it in action here

New features v. 1.0.2

Props

PropertyTypeDefaultDescription
New props⭐️⭐️⭐️
automatic (Stories component)BooleantrueToggle stories autoplaying state
onStoryChange (Stories component)Event(prev, current, next) => { }It is triggered every time the displayed story change, either manually, keyboardNavigation or automatic.
hideStoryProgress (story object)BooleanfalseHide to top progress indicator, useful when a custom nav is added, take a peek at the preview
preventChangeSideTapped (story object)BooleanfalseDisable going to prev/next story when you are tapping the left-right side.

Features v. 1.0.1

Story object props

PropertyDescription
New props on this fork⭐️
clickableOptional. Allow the content:({action,isPaused}) children elements to be clickeable. As a side-effect story won't pass to next-previous on touch right-leftt
stopOnClickOptional. If it true, the story will stop when the children elements are tapped/clicked
onStoryClickedOptional. Fires when an element is/clicked tapped. params (currentId, story, e.target)

Documentation

API documentation available here.

Example

Look at the gif example code here.

License

MIT © davidramos-om

1.0.3

1 year ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago