2023-05-14 22:35:00 +00:00
|
|
|
# TimePicker
|
|
|
|
|
|
|
|
Time input
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
```js
|
|
|
|
import TimePicker from "@docspace/components/time-picker";
|
|
|
|
```
|
|
|
|
|
|
|
|
```jsx
|
|
|
|
<TimePicker
|
|
|
|
date={new Date()}
|
|
|
|
setDate={setDate}
|
|
|
|
hasError={true}
|
|
|
|
onChange={(date) => console.log(date)}
|
|
|
|
/>
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Properties
|
|
|
|
|
2023-07-05 09:13:12 +00:00
|
|
|
| Props | Type | Required | Values | Default | Description |
|
|
|
|
| --------------- | :------: | :------: | :----: | :-----: | ------------------------------------------------ |
|
|
|
|
| `className` | `string` | - | - | '' | Allows to set classname |
|
|
|
|
| `date` | `object` | - | - | - | Inital date |
|
|
|
|
| `setDate` | `func` | - | - | - | State setter function |
|
|
|
|
| `onChange` | `func` | - | - | - | Allow you to handle changing events of component |
|
|
|
|
| `hasError` | `bool` | - | - | false | Indicates error |
|
|
|
|
| `onBlur` | `func` | - | - | - | Triggers function on blur |
|
|
|
|
| `focusOnRender` | `bool` | - | - | false | Focus input on render |
|
2023-07-06 15:13:40 +00:00
|
|
|
| `forwardedRef` | `object` | - | - | false | Passes ref to child component |
|