Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »


2.0.2 • Public • Published

Main image


A React component for Instagram like stories


NPM JavaScript Style Guide Backers on Open Collective Sponsors on Open Collective

What's new in v2? 🚀

  • Render your own components/JSX in stories
  • Create multiple instances to recreate stories by multiple users easily, jump to stories using props
  • Prop based control, event callbacks
  • Custom JSX gives control to pause/play story
  • (for devs) TypeScript 🎉
  • (for devs) Updated for easier feature additions, hooks

What's breaking in v2? 🚨

  • Ref based APIs are no more supported, replace them with new prop based controls.
  • seeMore property should now be a React component or a function.
Demo screenshot


npm install --save react-insta-stories


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. See it in action here: https://mohitk05.github.io/react-insta-stories/


import React, { Component } from 'react';
import Stories from 'react-insta-stories';
class App extends Component {
    render() {
        return (
const stories = [
        url: 'https://picsum.photos/1080/1920',
        seeMore: ({ close }) => (
            <div style={{ width: '100%', height: '100%' }}>Hello</div>
        header: {
            heading: 'Mohit Karekar',
            subheading: 'Posted 5h ago',
            profileImage: 'https://picsum.photos/1000/1000'
        header: {
            heading: 'Mohit Karekar',
            subheading: 'Posted 32m ago',
            profileImage: 'https://picsum.photos/1080/1920'
        header: {
            heading: 'mohitk05/react-insta-stories',
            subheading: 'Posted 32m ago',
        url: 'https://storage.googleapis.com/coverr-main/mp4/Footboys.mp4',
        type: 'video',
        duration: 1000
        type: 'video',
        seeMore: ({ close }) => (
            <div style={{ width: '100%', height: '100%' }}>Hello</div>
        type: 'video'


Property Type Default Description
stories [String/Object] required An array of image urls or array of story objects (options described below)
defaultInterval Number 1200 Milliseconds duration for which a story persists
loader Component Ripple loader A loader component as a fallback until image loads from url
header Component Default header as in demo A header component which sits at the top of each story. It receives the header object from the story object. Data for header to be sent with each story object.
width Number 360 Width of the component in pixels
height Number 640 Height of the component in pixels
storyStyles Object none Override the default story styles mentioned below.
loop Boolean false The last story loop to the first one and restart the stories.
New props ⭐️ ⭐️ ⭐️
isPaused Boolean false Toggle story playing state
currentIndex Number undefined Set the current story index
onStoryStart Function - Callback when a story starts
onStoryEnd Function - Callback when a story ends
onAllStoriesEnd Function - Callback when all stories in the array have ended

Story object

Instead of simple string url, a comprehensive 'story object' can also be passed in the stories array.

Property Description
url The url of the resource, be it image or video.
duration Optional. Duration for which a story should persist.
header Optional. Adds a header on the top. Object with heading, subheading and profileImage properties.
seeMore Optional. Adds a see more icon at the bottom of the story. On clicking, opens up this component. (v2: updated to Function instead of element)
type Optional. To distinguish a video story. type: 'video' is necessary for a video story.
styles Optional. Override the default story styles mentioned below.

Default story styles

Following are the default story content styles. Override them by providing your own style object with each story or a global override by using the storyStyles prop.

storyContent: {
    width: 'auto',
    maxWidth: '100%',
    maxHeight: '100%',
    margin: 'auto'

API (only for v1)

🚨 APIs will be deprecated from v2, and will be replaced by props based control. Check out '⭐️ new props' in the props table above.

Following functions can be accessed using the ref of default export, e.g. this.stories.pause()

pause(overrideHideProgress: Boolean)

Pause the currently playing story. Pass true to override the default hiding of progress bars.


Play a paused story.


Jump to the previous story. Similar to when tapped on left side of the screen.


Jump to the next story. Similar to when tapped on right side of the screen.

toggleSeeMore(show: Boolean)

Show or hide the Show More component. Pass true to show and otherwise.


This project exists thanks to all the people who contribute.


Thank you to all our backers! 🙏 Become a backer


Support this project by becoming a sponsor. Become a sponsor


MIT © mohitk05


npm i react-insta-stories

DownloadsWeekly Downloads






Unpacked Size

284 kB

Total Files


Last publish


  • avatar