storybookjs/storybook

How to show viewport on the docs page?

Open

#9,218 opened on 2019年12月22日

GitHub で見る
 (2 comments) (16 reactions) (0 assignees)TypeScript (89,909 stars) (10,058 forks)batch import
addon: docsaddon: viewporthelp wantedmediumtriage:reviewed

説明

Describe the bug How to show viewport on the docs page? The canvas page has viewport options,But the documentation page is not。Is this a bug or does it require additional configuration?

Screenshots The canvas page has viewport options. image

But the documentation page is not。 image

Code snippets

import { configure, addParameters } from '@storybook/react'
import { DocsPage, DocsContainer } from '@storybook/addon-docs/blocks'
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'
import '../src/index.less'

addParameters({
    viewport: {
        viewports: INITIAL_VIEWPORTS
    },
    docs: {
        container: DocsContainer,
        page: DocsPage
    }
})

コントリビューターガイド