Month Range Picker
Select a range of months.
Demos
Size
2026
Usage
vue
<script setup lang="ts">
import { Accordion } from '~/components/ui/accordion'
const items = [
{ value: 'source', label: 'Do I own the source?', content: 'Yes. Copy and adapt the files.' },
]
</script>
<template>
<Accordion :items="items" />
</template>
Installation
Complete the shared installation. Copy MonthRangePicker.vue and index.ts into app/components/ui/month-range-picker/.
app/components/ui/month-range-picker/MonthRangePicker.vue
<script setup lang="ts">
import { AlertDialog as Primitive } from 'akaza-ui'
import { computed, useAttrs, useTemplateRef } from 'vue'
import { cn } from '../../../utils/ui'
import uiConfig from '../ui.config'
import {
alertDialogVariants,
resolveAlertDialogVariants,
type AlertDialogProps,
type AlertDialogSlots,
} from './index'
defineOptions({ inheritAttrs: false })
// Preserve Akaza defaults when optional props, including Boolean aliases, are omitted.
const props = withDefaults(defineProps<AlertDialogProps>(), {
as: undefined,
teleport: undefined,
transition: undefined,
duration: undefined,
title: undefined,
ariaLabel: undefined,
description: undefined,
ui: undefined,
modelValue: undefined,
})
defineSlots<AlertDialogSlots>()
const attrs = useAttrs()
const styles = computed(() => alertDialogVariants(resolveAlertDialogVariants(props, uiConfig)))
const mergedUi = computed(() => {
const overrides = props.ui as Record<string, string | undefined> | undefined
return Object.fromEntries(
Object.entries(styles.value).map(([part, style]) => [
part,
cn(style(), overrides?.[part], part === 'content' ? props.class : undefined),
]),
)
})
const primitiveProps = computed(() => {
const { class: _class, ui: _ui, width: _width, ...native } = props
return native
})
const primitive = useTemplateRef<InstanceType<typeof Primitive>>('primitive')
defineExpose({
get open() {
return primitive.value!.open
},
get close() {
return primitive.value!.close
},
get toggle() {
return primitive.value!.toggle
},
get titleId() {
return primitive.value!.titleId
},
get descriptionId() {
return primitive.value!.descriptionId
},
})
</script>
<template>
<component
:is="Primitive"
ref="primitive"
v-bind="{ ...primitiveProps, ...attrs }"
:ui="mergedUi"
>
<template v-for="(_, name) in $slots" #[name]="scope"
><slot :name="name as keyof AlertDialogSlots" v-bind="scope ?? {}"
/></template>
</component>
</template>
API
Variants and defaults
| Prop | Values | Default |
|---|---|---|
size | xs, sm, md, lg, xl | sm |
Models
| Model | Type | Default | Description |
|---|---|---|---|
v-model | CalendarDateRange | {} | Optional normalized start and end months. |
v-model:placeholder | CalendarDateValue | selected start or today | Year displayed by grid. |
See Range selection for preview fills and primary-colored endpoints.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
rangeColor | "secondary" | "accent" | "secondary" | Preview and committed middle fill; endpoints use primary. |
locale | string | "en-US" | Locale used for labels. |
dir | "ltr" | "rtl" | "ltr" | Reading direction and horizontal arrows. |
calendarLabel | string | "Month range picker" | Accessible root label. |
columns | number | 3 | Number of month columns. |
allowNonContiguousRanges | boolean | false | Allows blocked interior months. |
maximumMonths | number | — | Maximum inclusive range length. |
fixedDate | "start" | "end" | — | Keeps one endpoint fixed. |
disabled | boolean | false | Disables paging and selection. |
readOnly | boolean | false | Allows navigation but blocks selection. |
initialFocus | boolean | false | Focuses selected/current month on mount. |
minValue | CalendarDateValue | — | Earliest selectable month. |
maxValue | CalendarDateValue | — | Latest selectable month. |
isMonthDisabled | (date) => boolean | — | Marks months disabled. |
isMonthUnavailable | (date) => boolean | — | Marks months unavailable. |
nextPage | (placeholder) => CalendarDateValue | add one year | Custom next page. |
prevPage | (placeholder) => CalendarDateValue | subtract one year | Custom previous page. |
ui | MonthRangePickerUi | — | Classes for generated parts. |
Slots
| Slot | Props | Description |
|---|---|---|
previous | disabled | Previous control content. |
heading | label, items | Year heading. |
next | disabled | Next control content. |
month | date, label, selected, rangeStart, rangeEnd, inRange, highlighted, disabled, unavailable, focused | Month content and range state. |
footer | value, placeholder | Optional footer. |
Events
| Event | Payload | Description |
|---|---|---|
update:modelValue | CalendarDateRange | Fires after accepted range changes. |
update:placeholder | CalendarDateValue | Fires after accepted page changes. |
value-change | (range, details) | Cancelable range change. |
placeholder-change | (date, details) | Cancelable page change. |
Keyboard
| Key | Behavior |
|---|---|
| Arrow keys | Move one month horizontally or one columns row vertically. Horizontal movement reverses in RTL. |
Home / End | Moves to row boundary. |
PageUp / PageDown | Moves one year. |
Shift + PageUp / Shift + PageDown | Moves ten years. |
Enter / Space | Sets range start or completes range end. |
Pointer hover previews a pending range; touch activation selects endpoints without relying on hover.