Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocsPage: how to change canvas height without mdx? #13765

Closed
krutoo opened this issue Jan 29, 2021 · 7 comments
Closed

DocsPage: how to change canvas height without mdx? #13765

krutoo opened this issue Jan 29, 2021 · 7 comments

Comments

@krutoo
Copy link

krutoo commented Jan 29, 2021

Hi. How can i change iframe height in docs page for specific story without mdx?

Currently all iframes with stories in docs page has height 100px

@gdorsi
Copy link

gdorsi commented Jan 29, 2021

I've had a similar issue to yours and I've solved the problem by using the story parameters:

export default {
    title: 'Components/Dialog',
    component: Dialog,
    parameters: {
        layout: 'centered',
        docs: { page: Docs, inlineStories: false, iframeHeight: 600 },
    },
}

I think that would work also with component or global parameters but I haven't tried it.

@krutoo
Copy link
Author

krutoo commented Jan 30, 2021

@gdorsi Thank you, really. But where you find its in docs?

@shilman
Copy link
Member

shilman commented Feb 1, 2021

It's documented here https://github.com/storybookjs/storybook/blob/master/addons/docs/common/README.md#L67

@jonniebigodes At some point soon we need to find a way to get the relevant docs out of the addon-docs README files and into the main documentation.

@krutoo krutoo closed this as completed Feb 1, 2021
@kasparsuvi1
Copy link

kasparsuvi1 commented May 8, 2023

As from Storybook v7 use iframeHeight and inlineStories with new types:

export default {
  parameters: {
    docs: {
      story: {
        inline: false,
        iframeHeight: 700,
      },
    },
  },
} as Meta;

@adnanhamzeh
Copy link

@kasparsuvi1 it seems this is causing the source code not to render as expected when you click "Show code". If you remove the inline prop it renders normally again.

@nathanpower
Copy link

As from Storybook v7 use iframeHeight and inlineStories with new types:

This should probably be in the migration docs

@jkillian
Copy link

If you are using inline stories, something like this works to change story height in docs:

export default {
  parameters: {
    docs: {
      story: {
        height: '700px',
      },
    },
  },
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants