phoenix-components-library
Version:
Component library for Phoenix Frontend Projects.
60 lines (45 loc) • 1.18 kB
Markdown
```js
import { Select } from 'phoenix-components-library';
render() {
return (
<Select
placeholder="Select Placeholder"
options={data.map(({ name, value }) => ({ name, value }))}
selectHandler={this.selectHandler}
/>
);
}
```
<!-- STORY -->
- `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 | |
`options`
```js
PropTypes.arrayOf({
name: PropTypes.string,
value: PropTypes.string
});
```
`default`
```js
{
name: PropTypes.string,
value: PropTypes.string
}
```