@brighthr/component-employeepicker
v4.0.5
Published
To install, type the following into the command line at the root of your project:
Downloads
1,314
Readme
EmployeePicker
To install, type the following into the command line at the root of your project:
npm i @brighthr/component-employeepicker
To implement the EmployeePicker component into your project you’ll need to add the import:
import EmployeePicker from '@brighthr/component-employeepicker';
After adding import into your project you can use it simply like:
<EmployeePicker />
Props
| Name | Type | Default | Description |
|---------------|-----------------------|---------|---------------------------------------------------------------------|
| groupBy | string
| | The key in the employee object to group user by, e.g team
. |
| hideSelectAll | boolean
| false
| If true, adds the functionality to be able to select all the users. |
| toggleUsers | (ids: Id[]) => void
| | Function for setting the external state of users. |
| users | user
| | User object that defines the information of each user (see below). |
users prop
| Name | Type | Default | Description |
|-----------|-------------------|---------|---------------------------------------------------------------------------|
| disabled | boolean
| | If true
, the user cannot be selected. |
| firstName | string
| | First name of the user. |
| id | string
number
| | Id of the user. |
| lastName | string
| | Last name of the user. |
| selected | boolean
| | If true
, shows the user as being selected. |
| warning | React.ReactNode
| | Displays some information about the user, e.g <p>On annual leave</p>
. |