storybookjs/storybook

How to show viewport on the docs page?

Open

#9 218 ouverte le 22 déc. 2019

Voir sur GitHub
 (2 commentaires) (16 réactions) (0 assignés)TypeScript (10 058 forks)batch import
addon: docsaddon: viewporthelp wantedmediumtriage:reviewed

Métriques du dépôt

Stars
 (89 909 stars)
Métriques de merge PR
 (Merge moyen 7j 22h) (184 PRs mergées en 30 j)

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

Guide contributeur