How to use the @storybook/addon-contexts/preact.withContexts function in @storybook/addon-contexts

To help you get started, we’ve selected a few @storybook/addon-contexts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storybookjs / storybook / examples / preact-kitchen-sink / src / stories / addon-contexts.stories.js View on Github external
{
    title: 'CSS Themes',
    params: [
      {
        name: 'Forest',
        props: {
          style: { color: 'teal', background: '#00b894', height: '100vh', padding: '10px' },
        },
      },
    ],
  },
];

export default {
  title: 'Addons/Contexts',
  decorators: [withContexts(topLevelContexts)],
};

export const simpleCssTheming = () => (
  <div>I'm a children of the injected 'div' (where provides a theming context).</div>
);

simpleCssTheming.story = {
  name: 'Simple CSS Theming',

  parameters: {
    contexts: storyLevelContexts,
  },
};

@storybook/addon-contexts

Storybook Addon Contexts

MIT
Latest version published 4 years ago

Package Health Score

72 / 100
Full package analysis