How to use the @open-wc/storybook.withBackgrounds function in @open-wc/storybook

To help you get started, we’ve selected a few @open-wc/storybook 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 open-wc / open-wc / packages / generator-open-wc / generators / scaffold-demoing / templates / static / stories / example.stories.js View on Github external
<button>click me</button>
  `)
  .add('Action and method', () =&gt; html`
    <button> action('log2')(e.target)}&gt;click me</button>
  `);


storiesOf('Addon|Links', module)
  .add('To Welcome', () =&gt; html`
    <button>Go to welcome</button>
  `);


storiesOf('Addon|Backgrounds', module)
  .addDecorator(
    withBackgrounds([
      { name: 'twitter', value: '#00aced', default: true },
      { name: 'facebook', value: '#3b5998' },
    ]),
  )
  .add('Button with text', () =&gt; `
    <button>Click me</button>
    <p>See tab "Backgrounds" at the bottom</p>
  `);


storiesOf('Addon|Notes', module)
  .addDecorator(withNotes)
  .add('Simple note', () =&gt; `
    <p><strong>See tab "notes" at the bottom.</strong></p>
  `, {
    notes: 'My notes on some <strong>bold</strong> text',

@open-wc/storybook

Storybook configuration following open-wc recommendations

MIT
Latest version published 6 years ago

Package Health Score

64 / 100
Full package analysis

Similar packages