UNPKG

phoenix-components-library

Version:

Component library for Phoenix Frontend Projects.

60 lines (45 loc) 1.18 kB
# Select ### Usage ```js import { Select } from 'phoenix-components-library'; render() { return ( <Select placeholder="Select Placeholder" options={data.map(({ name, value }) => ({ name, value }))} selectHandler={this.selectHandler} /> ); } ``` ### Live Example <!-- STORY --> ### Properties - `placeholder` - Select Placeholder - `default` - Default selected value - `options` - Options to show in Select - `selectHandler` - Select click callback function - `includeNone` - Include None as first option in select | propName | propType | defaultValue | isRequired | | ------------- | -------- | ------------ | ---------- | | placeholder | string | Select | | | default | object | text | | | options | array | - | + | | selectHandler | func | - | | | includeNone | bool | false | | #### Proptype Shape `options` ```js PropTypes.arrayOf({ name: PropTypes.string, value: PropTypes.string }); ``` `default` ```js { name: PropTypes.string, value: PropTypes.string } ``` ### Roadmap