question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Addon-backgrounds: Add parameter to enable grid by default

See original GitHub issue

Is your feature request related to a problem? Please describe. No.

Describe the solution you’d like I’d like a new Options Parameter to control the initial setting of the “Toggle Background Grid” setting, e.g. showBackgroundGrid, so that I can enable it by default.

Describe alternatives you’ve considered According to https://github.com/storybookjs/storybook/issues/5853#issuecomment-475466382 it looks like it’s possible to implement your own grid with the Storybook Background Addon.

Are you able to assist bring the feature to reality? No.

Additional context I think that should be enough info, but let me know if there’s anything else I can provide. Thanks!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:24
  • Comments:24 (5 by maintainers)

github_iconTop GitHub Comments

7reactions
morficuscommented, May 7, 2020

bumping this ticket again. would really love this option w/o a workaround

2reactions
anrusinacommented, Jun 24, 2022

Was able to achieve it with next values in preview.js:

export const globals = {
  backgrounds: {
    grid: true, //enable grid by default
  },
};

export const parameters = {
  ... 
  backgrounds: {
    default: 'neutral',
    values: [
      { name: 'white', value: '#fff' },
      { name: 'neutral', value: '#f5f3ef' },
      { name: 'black', value: '#000' },
    ],
  },
};

If I use both grid: true and default: 'neutral', in parameters/backgrounds section - grid would still be turned off by default 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backgrounds - Storybook - JS.ORG
Disable the grid. If you need to disable the grid for a specific story, set the backgrounds parameter to the following:.
Read more >
How do I set the grid cell size in Storybook 5? - Stack Overflow
I want to globally change the grid size to be 8px and I have tried the following: import { configure, addParameters } from...
Read more >
@storybook/addon-backgrounds | Yarn - Package Manager
Storybook Addon Backgrounds can be used to change background colors inside the preview in Storybook. Framework Support. React Storybook Screenshot ...
Read more >
Adding Grids and Borders
Does not apply grid lines to cells underneath a BY field value until the value changes. Column titles are not underlined. ON is...
Read more >
matplotlib.pyplot.grid — Matplotlib 3.6.2 documentation
Parameters : visiblebool or None, optional. Whether to show the grid lines. If any kwargs are supplied, it is assumed you want the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found