Skip to main content

Story View

Layout​

The Story View supports two layout modes that can be configured using the layout parameter.

Modern Layout​

Story View Modern Layout

To use the modern layout, set the parameter as follows:

<IASContainer storyReaderOptions={{
layout: StoryReaderLayout.Modern
}} />

Classic Layout​

Story View Classic Layout

To use the classic layout, set the parameter as follows:

<IASContainer storyReaderOptions={{
layout: StoryReaderLayout.Classic
}} />

Customization​

Below are the configuration options for customizing the Story View appearance.

Common options​

Common settings of the modal window for viewing story (close button, loader)

VariableTypeDescription
closeButtonPositionstringClose button position, one of start, end (for all readers).
closeButtonobjectClose button svg icon. (for all readers)
loader.default.colorstringDefault loader primary color. Valid css color. Default - white (for all readers)
loader.default.accentColorstringDefault loader accent color. Valid css color. Default - transparent (for all readers)
<IASContainer commonOptions={{
closeButton: {
svgSrc: {
baseState: "<svg>...</svg>"
};
}
}} />

Options​

ParameterTypeDescription
closeButtonPositionstringPosition of the close button. Possible values: start, end. Values left and right are marked as deprecated since version 2.14.0.
scrollStylestringScroll style of the story view pager. Possible values: flat, cover, cube.
loader.default.colorstringPrimary loader color. Any valid CSS color. Default: white.
loader.default.accentColorstringLoader accent color. Any valid CSS color. Default: transparent.
sharePanelobjectShare panel options.
commonBackdropobjectBackdrop options for the StoryReader.
slideBackdropobjectBackdrop options for story slides.
timelineBlockTopOffsetnumber | undefinedTop offset (in px) of the timeline block. Default: 5. Expands the backdrop below the block as well.
actionPanelBottomOffsetnumber | undefinedBottom offset (in px) of the ActionPanel. Default: 0. Also increases ActionPanel height.
closeButtonobjectOverride close button SVG icon.
likeButtonobjectOverride like button SVG icon.
dislikeButtonobjectOverride dislike button SVG icon.
favoriteButtonobjectOverride favorite button SVG icon.
muteButtonobjectOverride mute button SVG icon.
shareButtonobjectOverride share button SVG icon.
navigationobjectOverride navigation buttons SVG icons.
borderRadiusnumberBorder radius of stories in px. Default: 5.
layoutstringStory view layout. Possible values: modern, classic. Default: classic.

Backdrop Options​

Configuration for the common backdrop.

ParameterTypeDescription
colorstringBackdrop color. Any valid CSS color. Example: rgba(0,0,0,.3). Default: rgba(0,0,0,1).
backdropFilterstring | nullCSS filter for the backdrop. Example: blur(10px). Default: null.

Story slide backdrop options​

VariableTypeDescription
opacitynumberSlide based image backdrop - opacity value. Default .56
blurnumberSlide based image backdrop - blur value. Default 30
linearGradientOverlayArray<string>Slide based image backdrop - Linear gradient overlay values. Default [rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%]

Example​

<IASContainer storyReaderOptions={{
scrollStyle: StoryReaderSwipeStyle.FLAT,
timelineBlockTopOffset: 8,
actionPanelBottomOffset: 0,
borderRadius: 12,
layout: StoryReaderLayout.Classic,
}} />

Action Bar​

The Action Bar is a key UI element that provides quick access to core interactive features. It consists of a set of intuitive icons, each responsible for a specific action.

Actions​

  • Like / Dislike

    Allows the user to express positive or negative feedback about the content.

  • Add to Favorites / Remove from Favorites

    Adds the content to a Favorites list for quick future access or removes it from the list.

  • Share

    Opens a sharing panel:

    • Desktop: bottom sheet,
    • Mobile: system share menu.
  • Mute / Unmute

    Controls media playback sound (video, audio, ads). Allows enabling or disabling sound instantly without interrupting playback.

Options​

You can enable/disable controls using commonOptions property

<IASContainer commonOptions={{
hasLike: true,
hasFavorite: true,
hasShare: true
}} />
ParameterTypeDescription
hasLikebooleanEnables the Like / Dislike action. Default false
hasFavoritebooleanEnables the Add to Favorites action. Default false
hasSharebooleanEnables the Share action. Default false

Customization​

  • Customize like or dislike button icon
<IASContainer storyReaderOptions={{
likeButton: {
svgSrc: {
baseState: "<svg>...</svg>"
},
},
dislikeButton: {
svgSrc: {
baseState: "<svg>...</svg>"
},
}
}} />
  • Customize favorite button icon
<IASContainer storyReaderOptions={{
favoriteButton: {
svgSrc: {
baseState: "<svg>...</svg>"
},
}
}} />
  • Customize share button icon
<IASContainer storyReaderOptions={{
shareButton: {
svgSrc: {
baseState: "<svg>...</svg>"
}
}
}} />
  • Customize action bar position
<IASContainer storyReaderOptions={{
actionPanelBottomOffset: 20
}} />

Events​

import { storyManager } from "@inappstory/react-sdk"

storyManager.on("clickOnStory", (payload) => console.log(payload));


showStory​

Description: Triggered when a story is opened (from slider or reader).

Payload:

FieldTypeDescription
idnumberStory ID.
titlestring?Story title.
slidesCountnumber?Number of slides in the story.
feedstring?Feed name where the story belongs.
sourcestring?Story source.
filterobjectApplied filters.
ugcPayloadobjectUGC-related payload.
extraFieldsobject?Custom attributes from the story payload.
defaultListLengthnumberDefault list length.
favoriteListLengthnumberFavorite list length.

closeStory​

Description: Triggered when a story is closed.

Payload:

FieldTypeDescription
idnumberStory ID.
titlestring?Story title.
slidesCountnumber?Number of slides in the story.
feedstring?Feed name where the story belongs.
sourcestring?Story source.
filterobjectApplied filters.
ugcPayloadobjectUGC-related payload.
extraFieldsobject?Custom attributes from the story payload.
defaultListLengthnumberDefault list length.
favoriteListLengthnumberFavorite list length.
actionstringClose action (closeReaderByCloseBtn, closeReaderByEscBtn, swipeDown, swipe, lastSlideClick, auto, externalCloseReader).

showSlide​

Description: Triggered when a slide is shown.

Payload:

FieldTypeDescription
idnumberStory ID.
titlestring?Story title.
slidesCountnumber?Number of slides in the story.
feedstring?Feed name where the story belongs.
sourcestring?Story source.
filterobjectApplied filters.
ugcPayloadobjectUGC-related payload.
extraFieldsobject?Custom attributes from the story payload.
defaultListLengthnumberDefault list length.
favoriteListLengthnumberFavorite list length.
indexnumberSlide index.
payloadstringSlide payload.

likeStory​

Description: Triggered when a user likes/unlikes a story.

Payload:

FieldTypeDescription
idnumberStory ID.
titlestring?Story title.
slidesCountnumber?Number of slides in the story.
feedstring?Feed name where the story belongs.
sourcestring?Story source.
filterobjectApplied filters.
ugcPayloadobjectUGC-related payload.
extraFieldsobject?Custom attributes from the story payload.
defaultListLengthnumberDefault list length.
favoriteListLengthnumberFavorite list length.
valuebooleantrue if liked, false if unliked.

dislikeStory​

Description: Triggered when a user dislikes/undislikes a story.

Payload:

FieldTypeDescription
idnumberStory ID.
titlestring?Story title.
slidesCountnumber?Number of slides in the story.
feedstring?Feed name where the story belongs.
sourcestring?Story source.
filterobjectApplied filters.
ugcPayloadobjectUGC-related payload.
extraFieldsobject?Custom attributes from the story payload.
defaultListLengthnumberDefault list length.
favoriteListLengthnumberFavorite list length.
valuebooleantrue if disliked, false if removed.

favoriteStory​

Description: Triggered when a user adds/removes a story to favorites.

Payload:

FieldTypeDescription
idnumberStory ID.
titlestring?Story title.
slidesCountnumber?Number of slides in the story.
feedstring?Feed name where the story belongs.
sourcestring?Story source.
filterobjectApplied filters.
ugcPayloadobjectUGC-related payload.
extraFieldsobject?Custom attributes from the story payload.
defaultListLengthnumberDefault list length.
favoriteListLengthnumberFavorite list length.
valuebooleantrue if favorited, false if removed.

shareStory​

Description: Triggered when a user clicks on story sharing.

Payload:

FieldTypeDescription
idnumberStory ID.
titlestring?Story title.
slidesCountnumber?Number of slides in the story.
feedstring?Feed name where the story belongs.
sourcestring?Story source.
filterobjectApplied filters.
ugcPayloadobjectUGC-related payload.
extraFieldsobject?Custom attributes from the story payload.
defaultListLengthnumberDefault list length.
favoriteListLengthnumberFavorite list length.

shareStoryWithPath​

Description: Triggered after successful creation of the sharing path.

Payload:

FieldTypeDescription
idnumberStory ID.
titlestring?Story title.
slidesCountnumber?Number of slides in the story.
feedstring?Feed name where the story belongs.
sourcestring?Story source.
filterobjectApplied filters.
ugcPayloadobjectUGC-related payload.
extraFieldsobject?Custom attributes from the story payload.
defaultListLengthnumberDefault list length.
favoriteListLengthnumberFavorite list length.
urlstringGenerated sharing URL.

widgetEvent​

Description: Triggered by widgets inside a story.

Payload:

FieldTypeDescription
namestringWidget name.
dataanyWidget-specific data.
extraFieldsobject?Custom attributes from the story payload.