Timepicker
An input with a simple dropdown/modal for selecting a time, uses native timepicker for mobile
Class props
Timepicker component
An input with a simple dropdown/modal for selecting a time, uses native timepicker for mobile
html
<o-timepicker></o-timepicker>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
active | The active state of the dropdown | boolean | - | false |
closeOnClick | Close dropdown on click | boolean | - | From config: timepicker: { |
creator | time creator function, default is new Date() | (() => Date) | - | From config: timepicker: { |
customValidity | Custom HTML 5 validation error to set on the form control | string | ((currentValue: Date | null, state: ValidityState) => string) | undefined | - | "" |
defaultMinutes | number | - | ||
defaultSeconds | number | - | ||
disabled | Same as native disabled | boolean | - | false |
enableSeconds | boolean | - | false | |
expanded | Makes input full width when inside a grouped or addon field | boolean | - | false |
formatter | Custom function to format a date into a string | ((date: Date) => string) | undefined | - | From config: timepicker: { |
hourFormat | 12 | "12" | "24" | 24 | - | ||
icon | Icon to be shown | string | - | From config: timepicker: { |
iconPack | Icon pack to use | string | mdi , fa , fas and any other custom icon pack | From config: timepicker: { |
iconRight | Icon to be added on the right side | string | - | From config: timepicker: { |
iconRightClickable | Make the icon right clickable | boolean | - | false |
incrementHours | number | - | 1 | |
incrementMinutes | number | - | 1 | |
incrementSeconds | number | - | 1 | |
inline | Display datepicker inline | boolean | - | false |
locale | Date format locale | string | - | From config: { |
maxTime | Max time to select | Date | - | |
minTime | Min time to select | Date | - | |
mobileBreakpoint | Mobile breakpoint as max-width value | string | - | From config: timepicker: { |
mobileModal | Enable dropdown mobile modal | boolean | - | From config: timepicker: { |
mobileNative | Enable mobile native input if mobile agent | boolean | - | From config: timepicker: { |
v-model | The input value state | Date | - | |
openOnFocus | Open dropdown on focus | boolean | - | From config: timepicker: { |
override | Override existing theme classes completely | boolean | - | |
parser | Custom function to parse a string into a date | ((date: string) => Date) | undefined | - | From config: timepicker: { |
placeholder | Input placeholder | string | - | |
position | Dropdown position | string | - | |
readonly | Same as native input readonly | boolean | - | false |
resetOnMeridianChange | Reset the time inputs when meridian changes | boolean | - | false |
rounded | Makes the input rounded | boolean | - | false |
size | Size of the button | string | small , medium , large | From config: timepicker: { |
teleport | Append the component to another part of the DOM. Set true to append the component to the body.In addition, any CSS selector string or an actual DOM node can be used. | string | boolean | object | - | From config: timepicker: { |
trapFocus | Dropdown trapFocus | boolean | - | From config: timepicker: { |
unselectableTimes | Define a list of times which can not be selected | Date[] | ((date: Date) => boolean) | - | |
useHtml5Validation | Enable HTML 5 native validation | boolean | - | From config: { |
Events
Event name | Properties | Description |
---|---|---|
focus | event Event - native event | on input focus event |
blur | event Event - native event | on input blur event |
invalid | event Event - native event | on input invalid event |
icon-click | event Event - native event | on icon click event |
icon-right-click | event Event - native event | on icon right click event |
update:modelValue | value Date - updated modelValue prop | modelValue prop two-way binding |
update:active | value boolean - updated active prop | active prop two-way binding |
Slots
Name | Description | Bindings |
---|---|---|
trigger | Override the trigger | |
default | Define an additional content on footer |
Sass variables
Current theme ➜ Oruga
SASS Variable | Default |
---|---|
$timepicker-font-size | var(--#{$prefix}base-font-size) |
$timepicker-box-line-height | var(--#{$prefix}base-line-height) |
$timepicker-box-padding | 0.375rem 1rem |
$timepicker-footer-padding | 0 0.5rem |
$timepicker-footer-margin | 0.875rem 0 0 0 |
$timepicker-select-line-height | var(--#{$prefix}base-line-height) |
$timepicker-select-padding | $control-padding-vertical $control-padding-horizontal |
$timepicker-select-color | #363636 |
$timepicker-select-font-weight | 600 |
$timepicker-select-placeholder-opacity | var( --#{$prefix}base-disabled-opacity) |
$timepicker-separator-font-weight | 600 |
See ➜ 📄 Full scss file
Current theme ➜ Bulma
The theme does not have any custom variables for this component.