New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-brandbook

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-brandbook

Quickly setup branding website with styles and navigations.

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

React Brandbook

Quickly setup a brand book with title, logo and a list of topics (with sub-topics).

It supports multiple themes and layouts where you can switch between different flavour of theme and page layout.

It is especially suitable for portfolios, style guides, resumes, or just any slides like pages.

Usage

  ReactDOM.render(
    <Book />,
    document.getElementById('root')
  )

where props supported includes,

You can replace them with any element, ex.

  const title = 'MyBook'
  const logo = (
    <Icon
      size={'auto'}
      children={<Logo />}
      style={{ position: 'relative', top: '-3px' }}
    />
  )

  <Book title={title} logo={logo} />

Topic

Each topic is a page that can be specified via an object with title and stories inside.

  const topics = [
    { title: 'Button', stories: buttonStories }
  ]

where each story again can be defined with title, text and body.

  const Demo = ({ story }) => ()
  const buttonStories = [
    {
      title: 'Normal',
      text: 'Normal button states',
      body: <Demo />
    },
    ...
  ]

Each story can be added via body attributes of topic stories. And it can be decorated with story as input if needed.

Navigation

In order to navigate from one topic to another topic, you can use story.goto(search), where search is the topic name that you want to go to.

  const Demo = ({ story }) => {
    const onClick = e => { story.goto('Button') }
    return (
      <p>Used in <code onClick={onClick}>Button</code></p>
    )
  }

Themes

  const fontFamily = 'Times New Rome'
  const themes = [
    { title: 'Light', theme: { mode: 'light', fontFamily } },
    { title: 'Dark', theme: { mode: 'dark', fontFamily } }
  ]

  return <Book themes={themes} />

Keywords

React

FAQs

Package last updated on 11 Nov 2020

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