Components

StoryElement

<StoryElement />

This component renders different types of story elements Qlitics event is fired on story-elements become visible (this can be disabled by passing a prop called disableAnalytics={true})

Example

import { StoryElement } from '@quintype/components';
function StoryCard(props){
  return <div>
    {props.card['story-elements'].map((element, index) => <StoryElement element={element} key={index} story={props.story}></StoryElement>)}
  </div>
}

For different quality images in Image Story Element, pass imageWidths and imageDefaultWidth as props

<StoryElement story={story} element={element} imageWidths={[420,1040,1600]} imageDefaultWidth={1040}/>

FIXME: the templates property will allow you to pass in a custom template to override the story elements type.