Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Added example of manual knobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gongreg committed Mar 28, 2017
1 parent 4d8556c commit 744b336
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
13 changes: 13 additions & 0 deletions example/stories/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
import React from 'react'
import { storiesOf } from '@kadira/storybook'
import { withSmartKnobs } from '../../src'
import { withKnobs, select } from '@kadira/storybook-addon-knobs';

import SmartKnobedComponent from './SmartKnobedComponent';
import SmartKnobedComponentMissingProps from './SmartKnobedComponentMissingProps';

const stub = fn => fn();

storiesOf('Example of smart Knobs', module)
.addDecorator(withSmartKnobs)
.addDecorator(withKnobs)
.add('full example', () => (
<SmartKnobedComponent />
))

storiesOf('Smart Knobs missing props', module)
.addDecorator(withSmartKnobs)
.addDecorator(withKnobs)
.add('example', () => (
<SmartKnobedComponentMissingProps foo="baz" />
))

storiesOf('Smart Knobs with manual knobs', module)
.addDecorator(stub)
.addDecorator(withSmartKnobs)
.addDecorator(withKnobs)
.add('example', () => (
<SmartKnobedComponent string={ select('string', ['1', '2', '3'], '2') }/>
))

0 comments on commit 744b336

Please sign in to comment.