4.0.2 • Published 6 years ago
storybook-addon-scissors v4.0.2
Storybook Addon Scissors
Requires storybook version 3+
Install
npm i -D storybook-addon-scissors
Usage
- Download and import device list from ChromeDevTools devices (or bring your own with instructions below)
- Create or open
.storybook/addons.js
and register the addon like below.
// addons.js
import '@storybook/addon-actions/register';
import registerScissors from 'storybook-addon-scissors';
import devicesJSON from './devices.json';
// registerScissors() takes an array of device objects with the following signature:
// [{
// uid: String (must be unique)
// title: String
// width: Number
// height: Number
// }]
// In the case of using the device list from ChromeDevTools,
// we can map them the following way.
const devices = devicesJSON.extensions.map(({ device }) => ({
uid: device.title,
title: device.title,
width: device.screen.vertical.width,
height: device.screen.vertical.height,
}));
registerScissors(devices);
4.0.2
6 years ago
4.0.1
6 years ago
4.0.0
6 years ago
3.0.1
7 years ago
3.0.0
7 years ago
2.0.4
7 years ago
2.0.3
7 years ago
2.0.2
7 years ago
1.0.11
7 years ago
1.0.10
7 years ago
1.0.9
7 years ago
1.0.8
7 years ago
1.0.7
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago