@jmhudak/storybook-react-live-decorator
v0.1.0
Published
A decorator to make story components editable
Downloads
2
Readme
react-live
decorator for @storybook/react
Prerequisites
Install storybook: https://storybook.js.org/docs/guides/guide-react/
1 liner:
npx -p @storybook/cli sb init --type react
Install
npm i @jmhudak/storybook-react-live-decorator --save-dev
Usage
// Button.stories.jsx
import React from "react";
import { Button } from "@storybook/react/demo";
import withLiveEdit from "../index.esm.js";
export default {
title: "Button"
};
export const defaultStory = () => <Button>Hello I am a Button</Button>;
defaultStory.story = {
name: "default",
decorators: [withLiveEdit({ Button })]
};
References
- https://storybook.js.org/docs/guides/guide-react/
- https://storybook.js.org/docs/basics/writing-stories/#decorators
- https://github.com/FormidableLabs/react-live
- https://github.com/FormidableLabs/prism-react-renderer/tree/master/tools/themeFromVsCode