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

@freightos/storybook-react-live

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

@freightos/storybook-react-live

react-live decorator for Storybook 6+ | renders story as react-live

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
Maintainers
1
Weekly downloads
 
Created
Source

storybook-react-live

react-live decorator for Storybook v6+

npm NPM

Installation

npm i -D @freightos/storybook-react-live

Usage

import withLiveEdit from '@freightos/storybook-react-live';

const code = `() => (
  <Center>
    <Button type="primary" size="large">
      Default
    </Button>
  </Center>
)`;

stories.add(
  'Live edit',
  withLiveEdit({
    code,
    scope: { Button }
  })
)

Props of withLiveEdit()

All props accepted by <LiveProvider /> and:

NamePropTypeDescription
themePropTypes.objectA prism-react-renderer theme object. See more here
editorStylePropTypes.objectStyles object for overriding editor styles
errorStylesPropTypes.objectStyles object for overriding error styles

Extend globally via .storybook/preview.js

Add property reactLive to parameters object. Accepts: scope and theme

export const parameters = {
  reactLive: {
    scope: { Button, Icon },
    theme: synthwave84
  },
};

:)

Keywords

FAQs

Package last updated on 13 Feb 2022

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