QuarterPicker
Inline quarter, multiple quarters and quarters range picker
Source
LLM docs
Docs
Package
Usage
QuarterPicker works the same way as MonthPicker, but with quarters
instead of months. The value is a date string in YYYY-MM-DD format that points to the first day
of the selected quarter, for example 2026-04-01 for Q2 2026. Use getQuarterStart exported from
@mantine/dates to get the first day of the quarter for any date:
Allow deselect
Set allowDeselect to allow users to deselect the currently selected quarter by clicking on it.
allowDeselect is disregarded when the type prop is range or multiple. When a quarter is
deselected, onChange is called with null.
Multiple quarters
Set type="multiple" to allow users to pick multiple quarters:
Quarters range
Set type="range" to allow users to pick a quarters range. The value is a tuple of the first day of
the first quarter and the first day of the last quarter:
Single quarter in range
By default, it is not allowed to select a single quarter as a range – when the user clicks the same quarter a second time, it is deselected.
To change this behavior, set the allowSingleDateInRange prop. allowSingleDateInRange is ignored when the
type prop is not range.
Presets
Use the presets prop to add custom quarter presets. Presets are displayed next to the calendar.
Any date inside the quarter can be used as a preset value.
@mantine/dates registers the dayjs quarterOfYear and advancedFormat plugins:
you can use dayjs().startOf('quarter') and the Q format token. To use the quarter unit with TypeScript,
extend dayjs with the quarterOfYear plugin in your code, as shown in the demo above.
To use presets with type="range", define the value as a tuple of two dates:
Default date
Use the defaultDate prop to set the date value that will be used to determine which year should be displayed initially.
Only the year part of the value is used. Note that if you set the date prop, then the defaultDate value will be ignored.
Min and max date
Set the minDate and maxDate props to define minimum and maximum dates. Quarters that end before minDate
or start after maxDate are disabled. If the previous/next year is not available, then the corresponding control will be disabled.
Add props to year and quarter control
You can add props to year and quarter controls with the getYearControlProps and getQuarterControlProps functions. Both functions accept a date as a single argument,
and props returned from the function will be added to the year/quarter control. For example, it can be used to disable a specific
control or add styles:
Number of columns
Set the numberOfColumns prop to define the number of pickers that will be rendered side by side:
Demo is not available on small screens. Make your screen larger to see the demo.
Max level
To disallow users from going to the decade level, set maxLevel="year":
Full width
Set the fullWidth prop to make the quarter picker stretch to fill 100% of its parent container width:
Size
Change year and quarter controls format
Use the yearsListFormat and quartersListFormat props to change the dayjs format of year/quarter controls:
Change label format
Use decadeLabelFormat and yearLabelFormat to change the dayjs format of the decade/year label:
Localization
Usually it is better to specify the @mantine/dates package locale in DatesProvider,
but you can also override the locale per component:
Native level select
Set the withNativeLevelSelect prop to replace the calendar header level button with a native <select> element:
Accessibility
Aria labels
Set the ariaLabels prop to specify aria-label attributes for next/previous controls:
Year/quarter control aria-label
Use getYearControlProps/getQuarterControlProps to customize the aria-label attribute:
Keyboard interactions
Note that the following events will only trigger if focus is on a quarter control. When arrow navigation reaches the edge of the grid, the calendar switches to the previous/next year and focuses the corresponding quarter.
When presets are used, only one preset button is in the tab order. With focus on a preset,
ArrowDown and ArrowUp move focus between presets without selecting them, Enter or Space
selects the focused preset, and Tab moves focus to the calendar.
When the level is changed with the keyboard (for example, Enter on the year label), focus
moves to the label of the new level or to the grid control in the tab order if the new level
does not have a clickable label.