JSPM

@storybook/addon-viewport

6.4.0-beta.23
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7560480
  • Score
    100M100P100Q201403F
  • License MIT

Build responsive components by adjusting Storybook’s viewport size and orientation

Package Exports

  • @storybook/addon-viewport
  • @storybook/addon-viewport/register

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@storybook/addon-viewport) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Storybook Viewport Addon

Storybook Viewport Addon allows your stories to be displayed in different sizes and layouts in Storybook. This helps build responsive components inside of Storybook.

Framework Support

Screenshot

Installation

Viewport is part of essentials and so is installed in all new Storybooks by default. If you need to add it to your Storybook, you can run:

npm i -D @storybook/addon-viewport

Then, add following content to .storybook/main.js:

module.exports = {
  addons: ['@storybook/addon-viewport'],
};

You should now be able to see the viewport addon icon in the the toolbar at the top of the screen.

Usage

The usage is documented in the documentation.