0.3.2 • Published 6 years ago
storybook-decorators v0.3.2
storybook-decorators
The project is in initial development. More decorators and documentation will be added.
Storybook-decorators provides common Storybook decorators for enhancing the prototyping experience. Decorators are independent of each other meaning it is possible to use only a subset of the decorators provided. The library also provides a compose
function for composing decorators in natural order.
Usage
First, add storybook-decorators
add a dependency to your project:
$ npm install --save --dev storybook-decorators
In your story files, import and use the decorators you want:
import {storiesOf} from "@storybook/react";
import {background, centered, compose} from "storybook-decorators";
// Using compose is not required, but it flips the application order for the decorators and thus is more natural to read.
const decorate = compose(background, centered);
storiesOf("SomeComponent", module)
.addDecorators(decorate)
.add("Story 1", () => <div>Story 1</div>);
License
MIT
0.3.2
6 years ago
0.3.1
6 years ago
0.3.0
6 years ago
0.3.0-beta.3
6 years ago
0.3.0-beta.2
6 years ago
0.3.0-beta.1
6 years ago
0.2.3
6 years ago
0.2.2
6 years ago
0.2.1
6 years ago
0.2.0
6 years ago
0.1.0
6 years ago
0.0.1
6 years ago