@storybook/addons#types JavaScript Examples

The following examples show how to use @storybook/addons#types. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: register.js    From rainbow-modules with MIT License 6 votes vote down vote up
addons.register(ADDON_ID, (api) => {
    addons.add(ADDON_ID, {
        title: 'View on Github',
        type: types.TOOLEXTRA,
        match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
        render: () => {
            const params = api.getCurrentParameter('viewOnGithub');
            if (params && params.fileName) {
                return <GithubLink fileName={params.fileName} />;
            }
            return null;
        },
    });
});
Example #2
Source File: register.js    From virtuoso-design-system with MIT License 6 votes vote down vote up
addons.register(ADDON_ID, () => {
  addons.add(PANEL_ID, {
    title: "Abstract",
    type: types.PANEL,
    render: ({ active, key }) => (
      <AddonPanel active={active} key={key}>
        <Panel />
      </AddonPanel>
    ),
    paramKey: PARAM_KEY
  });
});
Example #3
Source File: manager.js    From blade with MIT License 5 votes vote down vote up
addons.register(ADDON_ID, () => {
  addons.add(TOOL_ID, {
    type: types.TOOL,
    title: 'Toggle Visibility Of Internal Components',
    match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
    render: InternalStoryAddon,
  });
});