@times-stories/page
The page container for the @times-stories suite of packages
Installation
$ yarn add @times-stories/page
Usage
<Page> is the core primitive, and should be used as the children of the
<Story /> component. It takes a function as its children passing on useful
props:
props = {
pageIndex
isActive
isOutbound
isInbound
isUpcoming
isMuted
withAnimations
handlers.setActivePage
handlers.toggleMuteState
}
This is required to map between the context-aware <Story> component, and a
context-unaware template component such as <IntroductionPage>. You can also
use this to create your own custom templates.
import Story from "@times-stories/story";
import Page from "@times-stories/page";
export default () => (
<Story>
<Page>
{props => <IntroductionPage {...props} {...introductionProps} />}
</Page>
<Page>{props => <div>Your custom template that can use props</div>}</Page>
</Story>
);