diff --git a/packages/grafana-ui/src/components/Select/Select.story.tsx b/packages/grafana-ui/src/components/Select/Select.story.tsx new file mode 100644 index 00000000000..27601611c5d --- /dev/null +++ b/packages/grafana-ui/src/components/Select/Select.story.tsx @@ -0,0 +1,38 @@ +import React from 'react'; +import { storiesOf } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; +import { withKnobs, object } from '@storybook/addon-knobs'; +import { withCenteredStory } from '../../utils/storybook/withCenteredStory'; +import { UseState } from '../../utils/storybook/UseState'; +import { SelectableValue } from '@grafana/data'; +import { Select } from './Select'; + +const SelectStories = storiesOf('UI/Select/Select', module); + +SelectStories.addDecorator(withCenteredStory).addDecorator(withKnobs); + +SelectStories.add('default', () => { + const intialState: SelectableValue = { label: 'A label', value: 'A value' }; + const value = object>('Selected Value:', intialState); + const options = object>>('Options:', [ + intialState, + { label: 'Another label', value: 'Another value' }, + ]); + + return ( + + {(value, updateValue) => { + return ( +