How to use the @storybook/html.configure function in @storybook/html

To help you get started, we’ve selected a few @storybook/html 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 derhess / storybook-html-lab / .storybook / config.js View on Github external
addDecorator(
  withOptions({
    hierarchyRootSeparator: /\|/
  })
);

// automatically import all files ending in *.stories.js
const req = require.context("../stories", true, /.stories.js$/);
function loadStories() {
  // Make welcome story default
  require("../stories/index.stories");
  req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);
github JetBrains / ring-ui / .storybook / config.js View on Github external
});

addDecorator(withA11y);
addDecorator(stylesDecorator());

const req = require.context('../components', true, /\.examples\.js$/);

function loadStories() {
  return [
    // Make welcome stories default
    require('../components/welcome.examples'),
    ...req.keys().map(filename => req(filename))
  ];
}

configure(loadStories, module);
github JungleMinds / JM_Basic-Twig-Project / .storybook / config.js View on Github external
event = document.createEvent('Event')
    event.initEvent('reload', true, true)
  }

  window.dispatchEvent(event)

  return story()
})

// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /.stories.js$/)
function loadStories() {
  req.keys().forEach(filename => req(filename))
}

configure(loadStories, module)
github wikimedia / mediawiki-extensions-Popups / .storybook / config.js View on Github external
/**
     * enable/disable shortcuts
     * @type {Boolean}
     */
    enableShortcuts: true, // true by default
  }
} );


// automatically import all files ending in *.stories.js
const req = require.context('./stories', true, /.stories.js$/);
function loadStories() {
  req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);
github Esri / calcite-components / .storybook / config.js View on Github external
import { configure, addParameters, addDecorator } from '@storybook/html';
import centered from '@storybook/addon-centered/html';
import theme from './theme';

addDecorator(centered);
addParameters({
  backgrounds: [
    { name: 'Light', value: '#f8f8f8', default: true }
  ],
  options: {
    theme,
     isToolshown: false,
  }
});

configure(require.context('../src/components', true, /\.stories\.js$/), module);
github axa-ch / patterns-library / .storybook / config.js View on Github external
theme: create({
      base: 'light',
      brandTitle: 'AXA Living Styleguide',
      brandUrl: 'https://github.com/axa-ch/patterns-library/tree/develop',
      brandImage: logo,
    }),
  },
});

addDecorator(addReadme);

const landingpage = require.context('../src/landingpage', true, /(story\.(js|jsx)|demo.(js|jsx))$/);
const components = require.context('../src/components', true, /(story\.(js|jsx)|demo.(js|jsx))$/);
const demos = require.context('../src/demo', true, /(story\.(js|jsx)|demo.(js|jsx))$/);

configure(() => {
  landingpage.keys().forEach(landingpage);
  components.keys().forEach(components);
  demos.keys().forEach(demos);
}, module);
github nhn / tui.grid / packages / toast-ui.grid / .storybook / config.js View on Github external
import { configure, addDecorator } from '@storybook/html';
import { makeDecorator } from '@storybook/addons';
import Grid from '../src/grid';

const withDefaultConfig =  makeDecorator({
  name: 'withDefaultConfig',
  wrapper: (getStory, context) => {
    Grid.setLanguage('en');
    Grid.applyTheme({ preset: 'default' });
    return getStory(context);
  }
});

addDecorator(withDefaultConfig);
configure(require.context('../stories', true, /.stories.tsx?$/), module);
github DesignByOnyx / stencil-storybook-starter / .storybook / config.js View on Github external
const COLLECTIONS = [
  {
    name: 'Stencil Components',
    loader: require('../loader/index.cjs.js'),
    componentsCtx: require.context('../dist/collection', true, /\/components\/([^/]+)\/\1\.js$/),
    storiesCtx: require.context('../src', true, /\.story\.tsx$/)
  }
];

function loadStories() {
  COLLECTIONS.forEach(({ name, loader, componentsCtx, storiesCtx }) => {
    buildStencilStories(name, loader, componentsCtx, storiesCtx);
  });
}

configure(loadStories, module);
github rangle / mibank-micro-frontends / mibank-components / .storybook / config.js View on Github external
import { configure } from "@storybook/html";
const req = require.context("../src/", true, /\.stories\.ts$/);
function loadStories() {
  req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);

@storybook/html

Storybook HTML renderer

MIT
Latest version published 3 days ago

Package Health Score

98 / 100
Full package analysis