UI Customizations

JoinStories SDK offers different ways to display your widget. There are currently two available triggers:

  • Bubbles
  • Cards

Bubble Component

This component allows you to display our custom widget that display stories in an horizontal scrollable view with a Instagram-like UI.

Example

import { JoinStoriesView } from '@join-stories/react-native-widgets';

export default function Home() {
  return (
  	<SafeAreaView>
    	<Text>Welcome !</Text>
      <JoinStoriesView 
        alias="<your_join_alias>" 
        fontName="EBGaramond-ExtraBold"
        labelColor="#FFFF80"
        spacing={16}
        withLabel
        loaderColors={['#FF0000AA', '#FF0033FF']}
        loaderWidth={3}
        customParameters={{
          Food: 'burgers,vegetables',
          Age: '21',
        }}
        storyViewedIndicatorColor="#808080"
        playerBackgroundColor="#330000AA"
        playerVerticalAnchor="top"
        playerHorizontalMargins={10}
        playerCornerRadius={30}
        horizontalPadding={10}
        playerProgressBarDefaultColor="#FFFFFF33"
        playerProgressBarFillColor="#FFFFFF"
        playerProgressBarThickness={4}
        playerProgressBarRadius={8}
        horizontalMargin={12}
        hasPlayButton={true}
        labelSize={18}
        bubbleSize={80}
        maxStories={6}
        playerStandaloneAnimationOrigin="top"
      />
    </SafeAreaView>)
}

List of props

Here is the list of available props:

NameTypeDefaultDescription
aliasstring""Your widget alias, see Initial SDK Setup for explanations on how to find it.
maxStoriesnumber-1max number of stories to display. If value is -1, it will display all stories.
customParametersRecord<string,string>{}A dictionary of key,values to filter stories based on your audiences. See Targeting: Audiences for more info.
bubbleSizenumber74Bubble's height.
withLabelbooleantrueshow / hide stories labels.
labelColorstring#000000label's color in hexadecimal
fontNamestringAvenirlabel's font
labelSizenumber12label's size
hasPlayButtonbooleantrueshow / hide play button
spacingnumber12Space between bubbles.
storyViewedIndicatorColor#808080border's color when the story is read.
loaderColorsstring[][]a list of colors to display around the bubble.
loaderWidthnumber2border's thickness.
horizontalMarginnumber0internal component's margin.
horizontalPaddingnumber0internal component's padding.
styleViewStyleundefinedCustom React native style.

Component has also access to player's props. See Standalone Player.

Card Component

This component allows you to display our custom widget that display stories in an card format horizontally or on grid.

Example

import { JoinStoriesCardView } from '@join-stories/react-native-widgets';

export default function Home() {
  return (
  	<SafeAreaView>
    	<Text>Welcome !</Text>
      <JoinStoriesCardView 
        alias="<your_join_alias>" 
        format="list"
        hasOverlay={false}
        labelColor="#FF0000"
        playerBackgroundColor="#FFFFFF33"
        playerVerticalAnchor="top"
        playerHorizontalMargins={10}
        playerCornerRadius={30}
        playerProgressBarDefaultColor="#FFFFFF"
        playerProgressBarFillColor="#026EDA"
        playerProgressBarThickness={4}
        playerProgressBarRadius={8}
        horizontalPadding={20}
        cardRadius={35}
        cardElevation={5}
        spacing={15}
        maxStories={4}
        labelSize={18}
        customParameters={{
          Food: 'burgers,vegetables',
          Age: '21',
        }}
        withLabel={true}
        hasPlayButton={false}
        cardSize={25}
        horizontalMargin={20}
        column={4}
        playerStandaloneAnimationOrigin="top"
        fontName="EBGaramond-ExtraBold"
      />
    </SafeAreaView>)
}

List of props

Here is a list of available props:

NameTypeDefaultDescription
aliasstring""Your widget alias, see Initial SDK Setup for explanations on how to find it.
maxStoriesnumber-1max number of stories to display. If value is -1, it will display all stories.
customParametersRecord<string,string>{}A dictionary of key,values to filter stories based on your audiences. See Targeting: Audiences for more info.
formatgrid|listlistHow to display the cards. Either on one single line (list) or in a grid (grid)
columnnumber2Only works with grid format. Number of columns on the grid
cardSizenumberundefinedCard's height. By default a card is in 9:16 format and its height depends on the device's width and the number of columns.
withLabelbooleantrueshow / hide stories labels.
labelColorstring#FFFFFFlabel's color in hexadecimal
fontNamestringAvenirlabel's font
labelSizenumber12 (list)
19 (grid)
label's size
hasPlayButtonbooleantrueshow / hide play button
cardElevationnumber2card's shadow. Only works on Android.
cardRadiusnumber8 (list)
10 (grid)
card's border radius.
hasOverlaybooleantrueshow / hide overlay present at the bottom of each card (below the label).
spacingnumber6 (list)
16 (grid)
Space between cards.
horizontalMarginnumber0internal component's margin.
horizontalPaddingnumber0internal component's padding.
styleViewStyleundefinedCustom React native style.

Component has also access to player's props. See Standalone Player.

Standalone Player

This section shows supported customizations on the Standalone player.

Example

export default function Home() {
  const openPlayer = () => {
  	JoinStories.startStandalonePlayer({ 
      alias: '<your_join_alias>',
      playerBackgroundColor: '#000133',
      playerStandaloneAnimationOrigin: 'top',
      playerVerticalAnchor: 'center',
      playerHorizontalMargins: 30,
      playerCornerRadius: 10,
      playerProgressBarDefaultColor: '#002244',
      playerProgressBarFillColor: '#99AA00',
      playerProgressBarThickness: 4,
      playerProgressBarRadius: 8,
      customParameters: {
        Food: 'burgers,vegetables',
        Age: '21',
      },
    });
  }
  return (
  	<SafeAreaView>
    	<Button title="Open player" onPress={openPlayer} />
    </SafeAreaView>)
}

List of parameters

Here is a list of available props:

NameTypeDefaultDescription
aliasstring""Your widget alias, see Initial SDK Setup for explanations on how to find it.
customParametersRecord<string,string>{}A dictionary of key,values to filter stories based on your audiences. See Targeting: Audiences for more info.
playerBackgroundColorstring#000000player background's color in hexadecimal
playerStandaloneAnimationOrigintop | topLeft| topRight | bottom | bottomLeft | bottomRightbottomorigin of the player's open animation.
playerVerticalAnchortop|bottom |centertopchanges the player anchor when the player's height is smaller than screen height.
playerCornerRadiusnumber0player borders' radius
playerHorizontalMarginsnumber0player's horizontal margin
playerProgressBarDefaultColorstring#FFFFFF7Fprogress bar's default color
playerProgressBarFillColorstring#FFFFFFprogress bar's fill color
playerProgressBarThicknessnumber2progress bar thickness
playerProgressBarRadiusnumber6progress bar radius