storybookjs/storybook

How to show viewport on the docs page?

Open

#9,218 opened on Dec 22, 2019

View on GitHub
 (2 comments) (16 reactions) (0 assignees)TypeScript (10,058 forks)batch import
addon: docsaddon: viewporthelp wantedmediumtriage:reviewed

Repository metrics

Stars
 (89,909 stars)
PR merge metrics
 (Avg merge 7d 22h) (184 merged PRs in 30d)

Description

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
    }
})

Contributor guide