Usage
Use the v-model directive to control the selected date.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
{
"wait": "Loading client-side content..."
}Use the default-value prop to set the initial value when you do not need to control its state.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
{
"wait": "Loading client-side content..."
}@internationalized/date package which provides objects and functions for representing and manipulating dates and times in a locale-aware manner.Multiple
Use the multiple prop to allow multiple selections.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
{
"wait": "Loading client-side content..."
}Locale
Use the locale prop to change the locale of the calendar.
| 一 | 二 | 三 | å›› | 五 | å… | æ—¥ |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
{
"wait": "Loading client-side content..."
}Range
Use the range prop to select a range of dates.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
{
"wait": "Loading client-side content..."
}Color
Use the color prop to change the color of the calendar.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
{
"wait": "Loading client-side content..."
}Size
Use the size prop to change the size of the calendar.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
{
"wait": "Loading client-side content..."
}Disabled
Use the disabled prop to disable the calendar.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
{
"wait": "Loading client-side content..."
}Number Of Months
Use the numberOfMonths prop to change the number of months in the calendar.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
30 | 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
28 | 29 | 30 | 31 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
{
"wait": "Loading client-side content..."
}Month Controls
Use the month-controls prop to show the month controls. Defaults to true.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
{
"wait": "Loading client-side content..."
}Year Controls
Use the year-controls prop to show the year controls. Defaults to false.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
{
"wait": "Loading client-side content..."
}Fixed Weeks
Use the fixed-weeks prop to display the calendar with fixed weeks.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
{
"wait": "Loading client-side content..."
}Examples
With chip events
Use the Chip component to add events to specific days.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
With disabled dates
Use the is-date-disabled prop with a function to mark specific dates as disabled.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
With unavailable dates
Use the is-date-unavailable prop with a function to mark specific dates as unavailable.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
With min/max dates
Use the min-value and max-value props to limit the dates.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
With other calendar systems
You can use other calenders from @internationalized/date to implement a different calendar system.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
24 | 25 | 26 | 27 | 28 | 29 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 1 | 2 | 3 | 4 | 5 | 6 |
With external controls
You can control the calendar with external controls by manipulating the date passed in the v-model.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
As a DatePicker
Use a Button and a Popover component to create a date picker.
As a DateRangePicker
Use a Button and a Popover component to create a date range picker.
API
Props
Slots
Emits
Theme
export default defineAppConfig({
b24ui: {
calendar: {
slots: {
root: 'font-[family-name:var(--ui-font-family-primary)]',
header: 'flex items-center justify-between',
body: 'flex flex-col space-y-4 pt-4 sm:flex-row sm:space-x-4 sm:space-y-0',
heading: 'mx-auto text-center font-(--ui-font-weight-semi-bold) text-(--b24ui-typography-legend-color) truncate',
grid: 'w-full border-collapse select-none space-y-1 focus:outline-none',
gridRow: 'grid grid-cols-7 place-items-center',
gridWeekDaysRow: 'mb-1 grid w-full grid-cols-7',
gridBody: 'grid',
headCell: 'font-(--ui-font-weight-normal) text-(--ui-color-design-plain-na-content)',
cell: 'relative text-center cursor-pointer aria-disabled:cursor-not-allowed',
cellTrigger: 'm-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap focus-visible:ring-2 focus:outline-none text-(--b24ui-typography-label-color) data-disabled:text-(--ui-color-design-plain-na-content-secondary) data-unavailable:text-(--ui-color-design-plain-na-content-secondary) data-outside-view:text-(--ui-color-design-plain-na-content-secondary) data-[selected]:text-(--b24ui-color) focus-visible:ring-(--b24ui-background-hover) data-[selected]:bg-(--b24ui-background) data-today:not-data-[selected]:text-(--b24ui-background) data-[highlighted]:bg-(--b24ui-background) data-[highlighted]:text-(--b24ui-color) hover:not-data-[disabled]:not-data-[selected]:bg-(--b24ui-background) hover:not-data-[disabled]:not-data-[selected]:text-(--b24ui-color) data-unavailable:line-through data-unavailable:pointer-events-none data-today:font-(--ui-font-weight-semi-bold) transition'
},
variants: {
color: {
'air-primary': {
root: 'style-filled'
},
'air-primary-success': {
root: 'style-filled-success'
},
'air-primary-alert': {
root: 'style-filled-alert'
},
'air-primary-copilot': {
root: 'style-filled-copilot'
},
'air-primary-warning': {
root: 'style-filled-warning'
},
default: {
root: 'style-old-default'
},
danger: {
root: 'style-old-danger'
},
success: {
root: 'style-old-success'
},
warning: {
root: 'style-old-warning'
},
primary: {
root: 'style-old-primary'
},
secondary: {
root: 'style-old-secondary'
},
collab: {
root: 'style-old-collab'
},
ai: {
root: 'style-old-ai'
}
},
size: {
xs: {
heading: 'text-(length:--ui-font-size-md)',
cell: 'text-(length:--ui-font-size-sm)',
headCell: 'text-[10px]',
cellTrigger: 'size-[28px]',
body: 'space-y-2 pt-2'
},
sm: {
heading: 'text-(length:--ui-font-size-md)',
headCell: 'text-(length:--ui-font-size-sm)',
cell: 'text-(length:--ui-font-size-sm)',
cellTrigger: 'size-[28px]'
},
md: {
heading: 'text-(length:--ui-font-size-lg)',
headCell: 'text-(length:--ui-font-size-md)',
cell: 'text-(length:--ui-font-size-md)',
cellTrigger: 'size-[32px]'
},
lg: {
heading: 'text-(length:--ui-font-size-2xl)',
headCell: 'text-(length:--ui-font-size-lg)',
cell: 'text-(length:--ui-font-size-lg)',
cellTrigger: 'size-[36px] text-(length:--ui-font-size-lg)'
}
}
},
defaultVariants: {
size: 'md',
color: 'air-primary'
}
}
}
})
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'
export default defineConfig({
plugins: [
vue(),
bitrix24UIPluginVite({
b24ui: {
calendar: {
slots: {
root: 'font-[family-name:var(--ui-font-family-primary)]',
header: 'flex items-center justify-between',
body: 'flex flex-col space-y-4 pt-4 sm:flex-row sm:space-x-4 sm:space-y-0',
heading: 'mx-auto text-center font-(--ui-font-weight-semi-bold) text-(--b24ui-typography-legend-color) truncate',
grid: 'w-full border-collapse select-none space-y-1 focus:outline-none',
gridRow: 'grid grid-cols-7 place-items-center',
gridWeekDaysRow: 'mb-1 grid w-full grid-cols-7',
gridBody: 'grid',
headCell: 'font-(--ui-font-weight-normal) text-(--ui-color-design-plain-na-content)',
cell: 'relative text-center cursor-pointer aria-disabled:cursor-not-allowed',
cellTrigger: 'm-0.5 relative flex items-center justify-center rounded-full whitespace-nowrap focus-visible:ring-2 focus:outline-none text-(--b24ui-typography-label-color) data-disabled:text-(--ui-color-design-plain-na-content-secondary) data-unavailable:text-(--ui-color-design-plain-na-content-secondary) data-outside-view:text-(--ui-color-design-plain-na-content-secondary) data-[selected]:text-(--b24ui-color) focus-visible:ring-(--b24ui-background-hover) data-[selected]:bg-(--b24ui-background) data-today:not-data-[selected]:text-(--b24ui-background) data-[highlighted]:bg-(--b24ui-background) data-[highlighted]:text-(--b24ui-color) hover:not-data-[disabled]:not-data-[selected]:bg-(--b24ui-background) hover:not-data-[disabled]:not-data-[selected]:text-(--b24ui-color) data-unavailable:line-through data-unavailable:pointer-events-none data-today:font-(--ui-font-weight-semi-bold) transition'
},
variants: {
color: {
'air-primary': {
root: 'style-filled'
},
'air-primary-success': {
root: 'style-filled-success'
},
'air-primary-alert': {
root: 'style-filled-alert'
},
'air-primary-copilot': {
root: 'style-filled-copilot'
},
'air-primary-warning': {
root: 'style-filled-warning'
},
default: {
root: 'style-old-default'
},
danger: {
root: 'style-old-danger'
},
success: {
root: 'style-old-success'
},
warning: {
root: 'style-old-warning'
},
primary: {
root: 'style-old-primary'
},
secondary: {
root: 'style-old-secondary'
},
collab: {
root: 'style-old-collab'
},
ai: {
root: 'style-old-ai'
}
},
size: {
xs: {
heading: 'text-(length:--ui-font-size-md)',
cell: 'text-(length:--ui-font-size-sm)',
headCell: 'text-[10px]',
cellTrigger: 'size-[28px]',
body: 'space-y-2 pt-2'
},
sm: {
heading: 'text-(length:--ui-font-size-md)',
headCell: 'text-(length:--ui-font-size-sm)',
cell: 'text-(length:--ui-font-size-sm)',
cellTrigger: 'size-[28px]'
},
md: {
heading: 'text-(length:--ui-font-size-lg)',
headCell: 'text-(length:--ui-font-size-md)',
cell: 'text-(length:--ui-font-size-md)',
cellTrigger: 'size-[32px]'
},
lg: {
heading: 'text-(length:--ui-font-size-2xl)',
headCell: 'text-(length:--ui-font-size-lg)',
cell: 'text-(length:--ui-font-size-lg)',
cellTrigger: 'size-[36px] text-(length:--ui-font-size-lg)'
}
}
},
defaultVariants: {
size: 'md',
color: 'air-primary'
}
}
}
})
]
})