UNPKG

@swrve/core

Version:

Core set of Swrve UI Components

39 lines (34 loc) 963 B
import React from 'react' import { storiesOf } from '@storybook/react' import { withInfo } from '@storybook/addon-info' import Component from '@reach/component-component' import InputAutosize from './input-autosize' const stories = storiesOf('Core|InputAutosize', module) stories.add( 'default', () => { return ( <div className="m-4"> <Component initialState={{ value: '' }}> {({ setState, state }) => ( <InputAutosize maxLength={50} value={state.value} placeholder={'Input Autosize'} onChange={({ target: { value } }) => { setState({ value }) }} /> )} </Component> </div> ) }, { info: ` The Input Autosize component renders an Input component. It accepts all props associated with input attributes, general React-related props (e.g. onChange) and custom classNames. ` } )