Components
TimePicker
A Timepicker is a component that allows the user to select a time in a user-friendly way.
Code examples
<TimePicker />
Guidelines
Time pickers are used when you want the user to specify a time.
Pressing the left and right buttons will adjust the time by a predefined interval (5 minutes unless otherwise specified).
If the user should not be able to change the time, a time picker should not be used.
Code
<TimePicker />
import { TimePicker } from "@vygruppen/spor-react";
Lets the user pick a time
Props
Name | Type | Required? | Description |
|---|---|---|---|
value | Time | ||
defaultValue | Time | ||
onValueChange | (newTime: Time) => void | ||
minuteInterval | number | Number of minutes to round up or down when triggering the back and forward buttons. Default 30 (minutes) | |
label | string | ||
disabled | boolean | ||
invalid | boolean | ||
errorText | string[] | This prop give a feedback about the reason of the error to user in case there are any error. It works combined with the prop invalid set to true | |
variant | "core" | "floating" | "ghost"; | Defaults to core |