Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

@times-stories/page

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@times-stories/page

> The page container for the `@times-stories` suite of packages

latest
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

@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 // Number - the index of the current page
  isActive // Boolean - if this page is active
  isOutbound // Boolean - if this page is outbound
  isInbound // Boolean - if this page is inbound
  isUpcoming // Boolean - if this page is up next
  isMuted // Boolean - if the Story is muted
  withAnimations // Boolean - if animations are enabled in the Story
  handlers.setActivePage // Function(Number) - can be used to set the Story's active page
  handlers.toggleMuteState // Function - can be used to toggle the Story's mute state
}

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>
);

FAQs

Package last updated on 09 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts