How to use the @storybook/addon-links.hrefTo function in @storybook/addon-links

To help you get started, we’ve selected a few @storybook/addon-links 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 flow-typed / flow-typed / definitions / npm / @storybook / addon-links_v3.x.x / test_addon-links_v3.x.x.js View on Github external
it('should error on invalid args', () => {
    // $ExpectError
    hrefTo();

    // $ExpectError
    hrefTo({});

    // $ExpectError
    hrefTo(true, true);
  });
github storybookjs / storybook / lib / cli / generators / MITHRIL / template / stories / Welcome.js View on Github external
updateHref: async vnode => {
    const href = await hrefTo(vnode.attrs.kind, vnode.attrs.story);
    // eslint-disable-next-line no-param-reassign
    vnode.state.href = href;
    m.redraw();
  },
  view: vnode => (
github flow-typed / flow-typed / definitions / npm / @storybook / addon-links_v3.x.x / test_addon-links_v3.x.x.js View on Github external
it('returns a Promised string', () => {
    hrefTo('', '').then(result => (result: string));
  });
github storybookjs / storybook / examples / official-storybook / stories / addon-links.stories.js View on Github external
storiesOf('Addons|Links.Href', module).add('log', () => {
  hrefTo('Addons|Links.Href', 'log').then(href => action('URL of this story')({ href }));

  return <span>See action logger</span>;
});
github storybookjs / storybook / examples / html-kitchen-sink / stories / react / addon-links.stories.js View on Github external
() =&gt; {
    hrefTo('React|Links.Href', 'log').then(href =&gt; action('URL of this story')(href));

    return <span>See action logger</span>;
  },
  {
github storybookjs / storybook / examples / official-storybook / stories / addon-links / href.stories.js View on Github external
export const log = () =&gt; {
  hrefTo('Addons|Links.Href', 'log').then(href =&gt; action('URL of this story')(href));

  return <span>See action logger</span>;
};
log.story = {

@storybook/addon-links

Link stories together to build demos and prototypes with your UI components

MIT
Latest version published 3 days ago

Package Health Score

95 / 100
Full package analysis