kadirahq/storybook-addon-hello

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Hello World Addon

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.

Getting Started

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>


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.