How to use the @storybook/addons.types.TOOL 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 storybookjs / storybook / addons / coverage / src / register.tsx View on Github external
addons.register(ADDON_ID, api => {
  addons.add(PANEL_ID, {
    type: types.TOOL,
    title: 'Coverage',
    match: ({ viewMode }) => viewMode === 'story', // todo add type
    render: () => ,
  });

  addons.add(PANEL_ID, {
    type: types.PANEL,
    title: 'Coverage',
    match: ({ viewMode }) => viewMode === 'story', // todo add type
    render: ({ active, key }) => (
      
        
      
    ),
    paramKey: PARAM_KEY,
  });
github vizeat / storybook-addon-responsive-views / src / register.js View on Github external
addons.register('responsive-addon', (api) => {
  addons.addPanel('responsive-addon/panel', {
    title: 'Responsive Views',
    type: types.TOOL,
    match: ({ viewMode }) => viewMode === 'story',
    // eslint-disable-next-line react/display-name
    render: () => ,
  })
})
github storybookjs / storybook / lib / components / src / preview / preview.js View on Github external
(getElements, panels, actions, options, storyId, viewMode, location, path, baseUrl) => {
    const tools = getElementList(getElements, types.TOOL, [
      panels.filter(p => p.id !== 'canvas').length
        ? {
            render: () => (
              
                {panels.map((t, index) => {
                  const to = t.route({ storyId, viewMode, path, location });
                  const isActive = t.match({ storyId, viewMode, path, location });
                  return (
                    
                      {t.title}
                    
                  );
                })}
              
            ),
          }
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 / backgrounds / src / register.tsx View on Github external
addons.register(ADDON_ID, api => {
  addons.add(ADDON_ID, {
    title: 'Backgrounds',
    type: types.TOOL,
    match: ({ viewMode }) => viewMode === 'story',
    render: () => ,
  });
});
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 }) => ,
  });

  addons.add(PANEL_ID, {
    title: '',
    type: types.PREVIEW,
    render: PreviewWrapper as any,
  });
});
github storybookjs / storybook / addons / viewport / src / register.js View on Github external
addons.register(ADDON_ID, api => {
  addons.add(ADDON_ID, {
    title: 'viewport / media-queries',
    type: types.TOOL,
    match: ({ viewMode }) => viewMode === 'story',
    render: () => ,
  });
});
github storybookjs / storybook / addons / contexts / src / register.ts View on Github external
addons.register(ID, api =>
  addons.add(ID, {
    title: ID,
    type: types.TOOL,
    match: ({ viewMode }) => viewMode === 'story',
    render: () => createElement(ContextsManager, { api }),
  })
);
github storybookjs / storybook / lib / ui / src / components / preview / preview.tsx View on Github external
(
    getElements,
    queryParams,
    panels,
    api,
    options,
    storyId,
    viewMode = 'story',
    location,
    path,
    currentUrl
  ) => {
    const tools = getElementList(getElements, types.TOOL, [
      panels.filter((p: Panel) => p.id !== 'canvas').length
        ? {
            render: () => (
              
                
                  {panels.map((t: Panel, index: any) => {
                    const to = t.route({ storyId, viewMode, path, location });
                    const isActive = path === to;
                    return (
                      
                        {t.title}
                      
                    );
                  })}
github storybookjs / storybook / lib / ui / src / components / preview / preview.js View on Github external
(
    getElements,
    queryParams,
    panels,
    api,
    options,
    storyId,
    viewMode,
    docsOnly,
    location,
    path,
    baseUrl
  ) => {
    const tools = getElementList(getElements, types.TOOL, [
      panels.filter(p => p.id !== 'canvas').length
        ? {
            render: () => (
              
                
                  {panels.map((t, index) => {
                    const to = t.route({ storyId, viewMode, path, location });
                    const isActive = path === to;
                    return (
                      
                        {t.title}
                      
                    );
                  })}