-
Notifications
You must be signed in to change notification settings - Fork 2
Narrative
brandonk1234 edited this page Feb 23, 2017
·
2 revisions
The narrative is a great presentational component for displaying images and short bits of text in a slider like manner.
The props needed for this component are listed and explained below:
-
onChange
- This prop must be afunction
-
stage
- This prop must be anumber
-
items
- This prop must be aobject
with the given keys and values shown below in the example.
<Narrative
onChange={this.onChange}
stage={this.state.stage}
items={[
{
title: "Narrative Item title 1",
body: "All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet.",
itemIndex: 0,
_graphic: {
src: "http://placekitten.com/g/1024/300"
}
},
{
title: "Narrative Item title 2",
body: "All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet.",
itemIndex: 1,
_graphic: {
src: "http://placekitten.com/g/1024/300"
}
},
{
title: "Narrative Item title 3",
body: "All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet.",
itemIndex: 2,
_graphic: {
src: "http://placekitten.com/g/1024/300"
}
}
]}
/>
// ...React Component
getInitialState: function() {
return {
stage: 0
}
},
onChange: function(stage) {
this.setState({
stage: stage
});
},