How to use the @storybook/addons.addons.add function in @storybook/addons

To help you get started, we’ve selected a few @storybook/addons 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 microsoft / fast-dna / packages / fast-storybook-design-system-addon / src / register.tsx View on Github external
(api: API): void => {
        addons.add(PANEL_ID, {
            title: "FAST DesignSystem",
            type: types.PANEL,
            route: (options: RouteOptions): string => `info/${options.storyId}`,
            match: (options: MatchOptions): boolean => options.viewMode === "info",
            render: (options: RenderOptions) => (
                
            ),
        });
    }
);
github storybookjs / storybook / dev-kits / addon-roundtrip / src / register.tsx View on Github external
addons.register(ADDON_ID, () => {
  addons.add(PANEL_ID, {
    title: 'roundtrip',
    type: types.PANEL,
    render: ({ active, key }) => (
      
        
      
    ),
  });
});
github storybookjs / storybook / addons / design-assets / src / register.tsx View on Github external
addons.register(ADDON_ID, () => {
  addons.add(PANEL_ID, {
    title: 'design assets',
    type: types.PANEL,
    render: ({ active, key }) => (
      
        
      
    ),
    paramKey: PARAM_KEY,
  });
});
github storybookjs / storybook / addons / a11y / src / register.tsx View on Github external
addons.register(ADDON_ID, api => {
  addons.add(PANEL_ID, {
    title: '',
    type: types.TOOL,
    match: ({ viewMode }) => viewMode === 'story',
    render: () => ,
  });

  addons.add(PANEL_ID, {
    title: 'Accessibility',
    type: types.PANEL,
    render: ({ active, key }) => ,
    paramKey: PARAM_KEY,
  });

  addons.add(PANEL_ID, {
    title: '',
    type: types.PREVIEW,
    render: PreviewWrapper as any,
  });
});
github storybookjs / storybook / addons / graphql / src / register.js View on Github external
addons.register(ADDON_ID, () => {
    addons.add(ADDON_ID, {
      title: 'GraphiQL',
      type: types.TAB,
      route: ({ storyId }) => `/graphql/${storyId}`,
      match: ({ viewMode }) => viewMode === 'graphql',
      render: GQL,
    });
  });
}
github microsoftgraph / microsoft-graph-toolkit / .storybook / manager.js View on Github external
storybookAPI.on(STORIES_CONFIGURED, (kind, story) => {
    if (storybookAPI.getUrlState().path === '/story/*') {
      storybookAPI.selectStory('mgt-login', 'login');
    }
  });
  storybookAPI.on(STORY_MISSING, (kind, story) => {
    storybookAPI.selectStory('mgt-login', 'login');
  });

  const render = ({ active, key }) => (
    
      
    
  );

  addons.add('mgt/sign-in', {
    type: types.PANEL,
    title: 'Sign In',
    render,
    paramKey: PARAM_KEY
  });
});
github storybookjs / storybook / dev-kits / addon-parameter / src / register.tsx View on Github external
addons.register(ADDON_ID, () => {
  addons.add(PANEL_ID, {
    title: 'parameter',
    type: types.PANEL,
    render: ({ active, key }) => (
      
        <content>
      </content>
    ),
  });
});
github storybookjs / storybook / addons / docs / src / register.ts View on Github external
addons.register(ADDON_ID, () => {
  addons.add(PANEL_ID, {
    type: types.TAB,
    title: 'Docs',
    route: ({ storyId }) => `/docs/${storyId}`,
    match: ({ viewMode }) => viewMode === 'docs',
    render: () => null,
  });
});
github axa-ch / patterns-library / .storybook / addons / changelog / register.js View on Github external
addonAPI.register(ADDON_ID, api =&gt; {
  const render = ({ active, key }) =&gt; (
    
      
    
  );
  const title = 'Changelog';

  addons.add(PANEL_ID, {
    type: types.PANEL,
    title,
    render,
  });
});
github JosephusPaye / Keen-UI / .storybook / source-addon.js View on Github external
addons.register(ADDON_ID, () => {
    const render = ({ active, key }) =>
        React.createElement(
            AddonPanel,
            { active, key },
            React.createElement(SourcePanel, { active })
        );

    addons.add(PANEL_ID, {
        type: types.PANEL,
        title: 'Source',
        render,
        paramKey: PARAM_KEY,
    });
});