Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

brandai-storybook

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

brandai-storybook

Brand.ai React Storybook addon

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Storybook Brand.ai viewer

The Brand.ai viewer displays UI Components from a Brand.ai Design Library in Storybook.

brandai-react-storybook

Getting Started

Install:

npm install --save-dev brandai-storybook

Create a file called addons.js in your storybook config (default: .storybook) and add the following to addon.js :

// import default storybook addons
import '@kadira/storybook/addons'

import register from 'brandai-storybook';
register({ dataUrl:'<brandai-data-export-url>' });

Connecting to Brand.ai

In order to obtain the url required to connect to brand.ai, you first need to navigate to Brand.ai and log in. Once you're logged in, select the design library that you want to connect to React Storybook and click the Tools and Integrations in the header.

Tools and Integrations

From the tools and Integrations page select the Style Data Export application.

Data export app

In the Style Data Export application click on JSON in the left navigation menu and copy the Styles url

Data export app

Connecting the Brand.ai components to the Storybook.

Note that you will need edit permissions to the design library to connect components.

  1. To connect a component, the design library must be in edit mode Edit mode

  2. Click UI Components in the navigation menu and click on a component to see additional information.

  3. Copy the story URL from your storybook and paste it into the story URL field

Story url

The story URL contains a few pieces of information that we'll use to connect the design library to your storybook

  1. The full URL - in read-only mode, the link to your storybook will appear in the design library as a reference to the storybook
  2. We extract the story kind and the story name to create a connection between a Brand.ai component and a storybook story.

Note: If you want the same Brand.ai component to be displayed for multiple stories of the same kind, you can paste a partial URL containing only the selectedKind

http://localhost:9001/?selectedKind=Button

Refresh your Storybook and you should see a Design Library tab in the Storybook panel brandai-react-storybook

FAQs

Package last updated on 11 Jun 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc