Theme ➜ Bulma
Datepicker
An input with a simple dropdown/modal for selecting a date, uses native datepicker for mobile
Examples
Base
Selected: Sun Apr 06 2025 11:16:27 GMT+0000 (Coordinated Universal Time)
Show code
Min/Max date
Show code
Range
Selected: []
Show code
Multiple
Selected: []
Show code
Trigger
Show code
Programmatically
Show code
Slots
Show code
Events
Show code
Month picker
Show code
Class props
Class prop | Description | Props | Suffixes | |
---|---|---|---|---|
boxClass | Class of the Datepicker box where you choose the date. | |||
dropdownClasses | Classes to apply on internal dropdown component. More detail here | |||
footerClass | Class of the Datepicker footer. | |||
headerButtonsClass | Class of the Datepicker buttons inside the box. | |||
headerButtonsSizeClass | Class of the Datepicker buttons inside the box when a size is choosen. | size | small | |
headerClass | Class of the Datepicker header inside the box. | |||
inputClasses | Classes to apply on internal input component. More detail here | |||
listsClass | Class of the month and year selects container inside the Datepicker box. 🔍 Classes applied have a higher specificity than expected when mobileClass is applied | |||
mobileClass | Class of the Datepicker when on mobile. 👉 Switch to mobile view to see it in action! | |||
monthBodyClass | Class of the table body inside the box when type is month. | |||
monthCellClass | Class of the table cell when type is month. | |||
monthCellFirstHoveredClass | Class of the first hovered table cell during range selection when type is month. 👉 See it in action selecting a date range | |||
monthCellFirstSelectedClass | Class of the first selected table cell when in range when type is month. 👉 See it in action selecting a date range | |||
monthCellLastHoveredClass | Class of the last table cell hovered during range selection when type is month. 👉 See it in action selecting a date range | |||
monthCellLastSelectedClass | Class of the last selected table cell during range selection when type is month. 👉 See it in action selecting a date range | |||
monthCellSelectableClass | Class of the table cell that is selectable when type is month. | |||
monthCellSelectedClass | Class of table cell when it's selected when type is month. | |||
monthCellTodayClass | Class of the table cell of the current day when type is month. | |||
monthCellUnselectableClass | Class of the table cell that is unselectable when type is month. | |||
monthCellWithinHoveredClass | Class of the table cell when hovered during range selection when type is month. 👉 See it in action selecting a date range | |||
monthCellWithinHoveredRangeClass | Class of the table cell when hovered during range selection and cell is in range when type is month. 👉 See it in action selecting a date range | |||
monthCellWithinSelectedClass | Class of the table cells within the range when the range is selected when type is month. 👉 See it in action selecting a date range | |||
monthClass | Class of the Datepicker table inside the box when type is month. | |||
monthEventsClass | Class of the events container when type is month. | |||
monthTableClass | Class of the table container when type is month. | |||
nextButtonClass | Class of the next button inside the Datepicker box. 🔍 Classes applied have a higher specificity than expected when mobileClass is applied | |||
prevButtonClass | Class of the prev button inside the Datepicker box. 🔍 Classes applied have a higher specificity than expected when mobileClass is applied | |||
rootClass | Class of the root element. | |||
selectClasses | Classes to apply on internal select component (month and year list). More detail here | |||
sizeClass | Class of the Datepicker size. | size | small | |
tableBodyClass | Class of the table body inside the box. | |||
tableCellClass | Class of the table cell. | |||
tableCellEventsClass | Class of the cell of a row when at least one event is present. | |||
tableCellFirstHoveredClass | Class of the first hovered table cell during range selection. 👉 See it in action selecting a date range | |||
tableCellFirstSelectedClass | Class of the first selected table cell when in range. 👉 See it in action selecting a date range | |||
tableCellInvisibleClass | Class of the table cell when nearby month days are hidden. | |||
tableCellLastHoveredClass | Class of the last table cell hovered during range selection. 👉 See it in action selecting a date range | |||
tableCellLastSelectedClass | Class of the last selected table cell during range selection. 👉 See it in action selecting a date range | |||
tableCellNearbyClass | Class of the table cell when nearby days (prev/next month) are selectable. | |||
tableCellSelectableClass | Class of the table cell that is selectable. | |||
tableCellSelectedClass | Class of table cell when it's selected. | |||
tableCellTodayClass | Class of the table cell of the current day. | |||
tableCellUnselectableClass | Class of the table cell that is unselectable. | |||
tableCellWithinHoveredClass | Class of the table cell when hovered during range selection. 👉 See it in action selecting a date range | |||
tableCellWithinSelectedClass | Class of the table cells within the range when the range is selected. 👉 See it in action selecting a date range | |||
tableClass | Class of the Datepicker table inside the box. | |||
tableEventClass | Class of the event. | |||
tableEventIndicatorsClass | Class of the event indicator. | indicator | bars | |
tableEventVariantClass | Class of the event indicator when a `variant` is specified. | variant in event | primary | |
tableEventsClass | Class of the events container. | |||
tableHeadCellClass | Class of the cell inside the table header. | |||
tableHeadClass | Class of Datepicker header with days of the week inside the table. | |||
tableRowClass | Class of the table row. |
Datepicker component
An input with a simple dropdown/modal for selecting a date, uses native datepicker for mobile
html
<o-datepicker></o-datepicker>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
active | - | false | ||
ariaNextLabel | - | From config: datepicker: { | ||
ariaPreviousLabel | - | From config: datepicker: { | ||
closeOnClick | - | From config: datepicker: { | ||
customValidity | - | "" | ||
dateCreator | - | From config: datepicker: { | ||
dateFormatter | - | From config: datepicker: { | ||
dateParser | - | From config: datepicker: { | ||
dayNames | - | From config: datepicker: { | ||
disabled | - | false | ||
events | - | |||
expanded | - | false | ||
firstDayOfWeek | - | From config: datepicker: { | ||
focusedDate | - | |||
icon | - | From config: datepicker: { | ||
iconNext | - | From config: datepicker: { | ||
iconPack | - | From config: datepicker: { | ||
iconPrev | - | From config: datepicker: { | ||
iconRight | - | From config: datepicker: { | ||
iconRightClickable | - | false | ||
indicators | - | "dots" | ||
inline | - | false | ||
locale | - | From config: { | ||
maxDate | - | |||
minDate | - | |||
mobileBreakpoint | - | From config: datepicker: { | ||
mobileModal | - | From config: datepicker: { | ||
mobileNative | - | From config: datepicker: { | ||
v-model | - | null | ||
monthNames | - | From config: datepicker: { | ||
nearbyMonthDays | - | From config: datepicker: { | ||
nearbySelectableMonthDays | - | From config: datepicker: { | ||
openOnFocus | - | From config: datepicker: { | ||
override | - | |||
placeholder | - | |||
position | - | |||
readonly | - | false | ||
rounded | - | false | ||
rulesForFirstWeek | - | 4 | ||
selectableDates | - | |||
showWeekNumber | - | From config: datepicker: { | ||
size | - | From config: datepicker: { | ||
teleport | - | From config: datepicker: { | ||
trapFocus | - | From config: datepicker: { | ||
type | - | "date" | ||
unselectableDates | - | |||
unselectableDaysOfWeek | - | From config: datepicker: { | ||
useHtml5Validation | - | From config: { | ||
weekNumberClickable | - | From config: datepicker: { | ||
yearsRange | - | From config: datepicker: { |
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 |
range-start | value Date - range start date | on range start is selected event |
range-end | value Date - range end date | on range end is selected event |
update:modelValue | value Date | Date[] - updated modelValue prop | modelValue prop two-way binding |
update:active | value boolean - updated active prop | active prop two-way binding |
change-month | value number - month number | on month change event |
change-year | value number - year number | on year change event |
Slots
Name | Description | Bindings |
---|---|---|
trigger | Override the trigger | |
header | Override the header | |
body | Override the body | |
footer | Define an additional footer |
Sass variables
Current theme ➜ Oruga
SASS Variable | Default |
---|---|
$datepicker-font-size | var(--#{$prefix}base-font-size) |
$datepicker-box-line-height | var(--#{$prefix}base-line-height) |
$datepicker-box-padding | 0.375rem 1rem |
$datepicker-header-padding | 0 0 0.875rem 0 |
$datepicker-header-margin | 0 0 0.875rem 0 |
$datepicker-header-border-bottom | 1px solid var(--#{$prefix}grey-lighter) |
$datepicker-footer-padding | 0.875rem 0.5rem 0 0.5rem |
$datepicker-footer-margin | 0.875rem 0 0.875rem 0 |
$datepicker-footer-border-top | 1px solid var(--#{$prefix}grey-lighter) |
$datepicker-table-head-padding | 0 0 0.875rem 0 |
$datepicker-table-head-margin | 0 0 0.875rem 0 |
$datepicker-table-head-border-bottom | 1px solid var(--#{$prefix}grey-lighter) |
$datepicker-table-head-item-color | var(--#{$prefix}grey) |
$datepicker-table-head-item-font-weight | 600 |
$datepicker-item-today-border | solid 1px rgba(var(--#{$prefix}primary), 0.5) |
$datepicker-item-selectable-color | var(--#{$prefix}grey-dark) |
$datepicker-item-disabled-color | var(--#{$prefix}grey-light) |
$datepicker-item-border-radius | var(--#{$prefix}base-border-radius) |
$datepicker-item-padding | 0.5rem 0.75rem |
$datepicker-item-selected-color | var(--#{$prefix}primary-invert) |
$datepicker-item-selected-background-color | var(--#{$prefix}primary) |
$datepicker-item-selected-border-radius | 0 |
$datepicker-item-selected-within-background-color | rgb( from $datepicker-item-selected-background-color r g b / 50%) |
$datepicker-item-hovered-background-color | var(--#{$prefix}grey) |
$datepicker-item-hovered-color | var(--#{$prefix}grey-lighter) |
$datepicker-item-hovered-background-color | #f5f5f5 |
$datepicker-item-hovered-within-background-color | rgb( from $datepicker-item-hovered-background-color r g b / 50%) |
$datepicker-item-nearby-color | var(--#{$prefix}grey-light) |
$datepicker-events-item-padding | 0.3rem 0.75rem 0.75rem |
$datepicker-event-background-color | var(--#{$prefix}grey-light) |
$datepicker-event-dots-size | 0.35em |
$datepicker-event-dots-margin | 0 0.1em |
$datepicker-event-bars-height | 0.25em |
$datepicker-btn-border-color | var(--#{$prefix}grey-lighter) |
$datepicker-btn-border-radius | var(--#{$prefix}base-border-radius) |
$datepicker-btn-border | 1px solid transparent |
$datepicker-btn-color | #363636 |
$datepicker-btn-height | 2.25em |
$datepicker-btn-hover-border-color | var(--#{$prefix}grey-light) |
$datepicker-btn-hover-color | #363636 |
$datepicker-btn-line-height | var(--#{$prefix}base-line-height) |
$datepicker-btn-margin | 0.25rem |
$datepicker-btn-min-width | 2.25em |
$datepicker-btn-padding | 0.5em 0.5em |
See ➜ 📄 Full scss file
Current theme ➜ Bulma
SASS Variable | Default |
---|---|
$datepicker-colors | var.$colors |
$datepicker-header-color | css.getVar("grey") |
$datepicker-today-border | solid 1px rgba(css.getVar("primary"), 0.5) |
$datepicker-item-color | css.getVar("grey-dark") |
$datepicker-item-disabled-color | css.getVar("grey-light") |
$datepicker-item-hover-color | css.getVar("scheme-invert") |
$datepicker-item-hover-background-color | css.getVar("background") |
$datepicker-item-selected-color | css.getVar("primary-invert") |
$datepicker-item-selected-background-color | css.getVar("primary") |
$datepicker-event-background-color | css.getVar("grey-light") |
See ➜ 📄 Full scss file
Current theme ➜ Bootstrap
SASS Variable | Default |
---|---|
$datepicker-background-color | var(--#{$prefix}body-bg) |
$datepicker-pagination-spacer | calc($spacer * 0.5) |
$datepicker-section-spacer | calc($spacer * 0.75) |
$datepicker-section-border | 1px solid var(--#{$prefix}border-color) |
$datepicker-cell-padding | 0.5rem 0.75rem |
$datepicker-cell-font-weight | 400 |
$datepicker-cell-width | calc(#{100%} / 7) |
$datepicker-cell-border-width | 1px |
$datepicker-cell-border-color | transparent |
$datepicker-cell-border-radius | var(--#{$prefix}border-radius) |
$datepicker-cell-color | var(--#{$prefix}black) |
$datepicker-cell-bg | transparent |
$datepicker-cell-hovered-color | var(--#{$prefix}secondary-contrast) |
$datepicker-cell-hovered-bg | var(--#{$prefix}secondary) |
$datepicker-cell-selected-color | var(--#{$prefix}primary-contrast) |
$datepicker-cell-selected-bg | var(--#{$prefix}primary) |
$datepicker-month-width | 20rem |
$datepicker-month-cell-spacer | calc($spacer * 0.5) |
$datepicker-month-cell-height | 2.5rem |
$datepicker-dropdown-width | calc(100vw - 40px) |
$datepicker-dropdown-min-width | 380px |
$datepicker-dropdown-max-width | 420px |
See ➜ 📄 Full scss file