npm.io
1.11.0 • Published 3 years ago

@s-ui/react-form-select

Licence
MIT
Version
1.11.0
Deps
1
Size
9 kB
Vulns
0
Weekly
0

FormSelect

Wrapper around a select html element that gives a consistent look'n'feel across devices yet keeping the native functionality on being used.

Installation

$ npm install @s-ui/react-form-select --save

Usage

Basic usage
import FormSelect from '@s-ui/react-form-select'

const OPTIONS = [
  { key: 'default', value: '', content: '--Please choose an option--' },
  { key: 'dog', value: 'dog', content: 'Dog' },
  { key: 'cat', value: 'cat', content: 'Cat' },
  { key: 'hamster', value: 'hamster', content: 'Hamster' },
  { key: 'parrot', value: 'parrot', content: 'Parrot' }
]

return (
  <FormSelect
    options={OPTIONS}
    onChange={(e, data) => console.log(data)}
  />
)
@import '~@s-ui/react-form-select/lib/index';

Find full description and more examples in the demo page.