Name: storybook-addon-hello
Owner: KADIRA
Description: A simple hello-world example addon for storybook
Created: 2016-08-02 05:31:20.0
Updated: 2016-09-28 06:20:59.0
Pushed: 2016-10-04 06:42:21.0
Homepage: null
Size: 120
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
NOTE This is an example addon for Kadira Storybooks. Check the source code (and comments) to learn how to write addons. Also serves as a boilerplate for new addons.
The Hello World addon can be used to display a simple text message set by stories. This addon works with both React Storybook and React Native Storybook.
First, install the addon
install -D @kadira/storybook-addon-hello
Add this line to your addons.js
file (create this file inside your storybook config directory if needed).
rt '@kadira/storybook-addon-hello/register';
Import the hello
function and use it to create actions handlers. When creating action handlers, provide a string which should be visible on the panel.
rt { storiesOf } from '@kadira/storybook'
rt { hello } from '@kadira/storybook-addon-hello'
iesOf('Button', module)
dd('default view', () => (
<Button onClick={ hello('Hello World') }>
Hello World!
</Button>