storybook-addon-external-links
v2.0.3
Published
Provides a link to the story's source in the toolbar
Downloads
103
Maintainers
Readme
Storybook Addon Source Link
Provides a link to the story's source in the toolbar.
Usage
Inside each component, include a parameter for your components's source code.
*.stories.js
export default {
title: 'Example',
component: Button,
parameters: {
sourceLink: '<link to source>'
}
};
This can be done at the story level as well
*.stories.js
export const Primary = () => (
<Button>Primary</Button>
);
Primary.parameters = {
sourceLink: '<link to source>'
};
If the parameter is set, clicking the icon button will take you to the source link.
If an inactive source link is clicked, a tool-top will remind the user of this usage.
Alternatively, you may set a global parameter to define a default link in the .storybook/preview.js
file like so:
export const parameters = {
sourceLink: '<link to source>'
}
Precedence follows the rules of parameter inheritance