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

Commit 744b336

Browse files
committed
Added example of manual knobs.
1 parent 4d8556c commit 744b336

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

example/stories/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
import React from 'react'
22
import { storiesOf } from '@kadira/storybook'
33
import { withSmartKnobs } from '../../src'
4+
import { withKnobs, select } from '@kadira/storybook-addon-knobs';
45

56
import SmartKnobedComponent from './SmartKnobedComponent';
67
import SmartKnobedComponentMissingProps from './SmartKnobedComponentMissingProps';
78

9+
const stub = fn => fn();
10+
811
storiesOf('Example of smart Knobs', module)
912
.addDecorator(withSmartKnobs)
13+
.addDecorator(withKnobs)
1014
.add('full example', () => (
1115
<SmartKnobedComponent />
1216
))
1317

1418
storiesOf('Smart Knobs missing props', module)
1519
.addDecorator(withSmartKnobs)
20+
.addDecorator(withKnobs)
1621
.add('example', () => (
1722
<SmartKnobedComponentMissingProps foo="baz" />
1823
))
24+
25+
storiesOf('Smart Knobs with manual knobs', module)
26+
.addDecorator(stub)
27+
.addDecorator(withSmartKnobs)
28+
.addDecorator(withKnobs)
29+
.add('example', () => (
30+
<SmartKnobedComponent string={ select('string', ['1', '2', '3'], '2') }/>
31+
))

0 commit comments

Comments
 (0)