The Select component is a styled select drop-down form input that can be used as a controlled or uncontrolled component.
Installation
`` yarn add @paprika/select `
or with npm:
` npm install @paprika/select `
Props
$3
| Prop | Type | required | default | Description | | ------------ | ----------------------------------------------------------------------------- | -------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | a11yText | string | false | null | Provides a non-visible label for this select element for assistive technologies. | | children | node | false | null | List of options as standard option elements. | | defaultValue | string | false | null | Sets the default selected value for an uncontrolled component. | | hasError | bool | false | false | If true displays a red border around select element to indicate error. | | isDisabled | bool | false | false | If true it makes the select element disabled. | | isReadOnly | bool | false | false | If true it makes the select element read only. | | onChange | func | false | () => {} | Callback to be executed when the selected value is changed. Receives the onChange event as an argument. Required when value prop is provided (component is controlled). | | placeholder | string | false | null | Display value for a disabled first option with an empty string value. | | size | [ Select.types.size.SMALL, Select.types.size.MEDIUM, Select.types.size.LARGE] | false | Select.types.size.MEDIUM | Specifies the visual size of the select element. | | value | string | false | undefined | The selected value for the select element. |
$3
All props and attributes are spread onto the root container