Select
Select component made with @mui/material/Select
Props
- options - (required) Array of options for the select
- label - (required) Label for the select
- control - (required) Control from react-hook-form
- name - (required) Name of the select
- sx - (not required) sx props from @mui/material
- fullWidth - (not required) if true then select will be full width
Usage
import { Select } from 'react-componentry';
import { Control } from 'react-hook-form';
const App = () => {
const { control } = useForm();
return (
<Select
control={control}
name="name"
label="Name"
options={[
{ value: '1', label: 'One' },
{ value: '2', label: 'Two' },
{ value: '3', label: 'Three' },
]}
/>
);
};