QuarterPickerInput

Quarter, multiple quarters and quarters range picker input

QuarterPicker props

QuarterPickerInput supports most of the QuarterPicker props. Features that are not listed on this page are documented there.

QuarterPickerInput with uncontrolled forms

Set name to submit the first day of the selected quarter as YYYY-MM-DD:

import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <form
      onSubmit={(event) => {
        event.preventDefault();
        const data = new FormData(event.currentTarget);
        console.log(data.get('quarter'));
      }}
    >
      <QuarterPickerInput
        name="quarter"
        label="Quarter"
        defaultValue="2025-04-01"
      />
      <button type="submit">Submit</button>
    </form>
  );
}

Usage

The value is a date string in YYYY-MM-DD format pointing to the first day of the selected quarter:

import { useState } from 'react';
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  const [value, setValue] = useState<string | null>(null);
  return (
    <QuarterPickerInput
      label="Pick date"
      placeholder="Pick date"
      value={value}
      onChange={setValue}
    />
  );
}

Multiple quarters

Set type="multiple" to allow users to pick multiple quarters:

import { useState } from 'react';
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  const [value, setValue] = useState<string[]>([]);
  return (
    <QuarterPickerInput
      type="multiple"
      label="Pick dates"
      placeholder="Pick dates"
      value={value}
      onChange={setValue}
    />
  );
}

Set valueDisplay="pills" to show every selected quarter as a pill with a remove button, the same way MultiSelect shows its values. Backspace in the input removes the last quarter:

import { useState } from 'react';
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  const [value, setValue] = useState<string[]>([]);
  return (
    <QuarterPickerInput
      type="multiple"
      valueDisplay="pills"
      label="Pick dates"
      placeholder="Pick dates"
      value={value}
      onChange={setValue}
      clearable
    />
  );
}

Quarters range

Set type="range" to allow users to pick a quarters range:

import { useState } from 'react';
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  const [value, setValue] = useState<[string | null, string | null]>([null, null]);
  return (
    <QuarterPickerInput
      type="range"
      label="Pick dates range"
      placeholder="Pick dates range"
      value={value}
      onChange={setValue}
    />
  );
}

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:

import dayjs from 'dayjs';
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
import { QuarterPickerInput } from '@mantine/dates';

dayjs.extend(quarterOfYear);

function Demo() {
  return (
    <QuarterPickerInput
      label="Pick quarter"
      placeholder="Pick quarter"
      presets={[
        { value: dayjs().startOf('quarter').format('YYYY-MM-DD'), label: 'This quarter' },
        { value: dayjs().add(1, 'quarter').startOf('quarter').format('YYYY-MM-DD'), label: 'Next quarter' },
        { value: dayjs().subtract(1, 'quarter').startOf('quarter').format('YYYY-MM-DD'), label: 'Last quarter' },
        { value: dayjs().add(1, 'year').startOf('year').format('YYYY-MM-DD'), label: 'Q1 next year' },
      ]}
    />
  );
}

To use presets with type="range", define the value as a tuple of two dates:

import dayjs from 'dayjs';
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
import { QuarterPickerInput } from '@mantine/dates';

dayjs.extend(quarterOfYear);

function Demo() {
  return (
    <QuarterPickerInput
      type="range"
      label="Pick quarters range"
      placeholder="Pick quarters range"
      presets={[
        {
          value: [dayjs().startOf('year').format('YYYY-MM-DD'), dayjs().startOf('quarter').format('YYYY-MM-DD')],
          label: 'Year to date',
        },
        {
          value: [dayjs().startOf('year').format('YYYY-MM-DD'), dayjs().startOf('year').add(9, 'month').format('YYYY-MM-DD')],
          label: 'This year',
        },
        {
          value: [dayjs().subtract(1, 'year').startOf('year').format('YYYY-MM-DD'), dayjs().subtract(1, 'year').startOf('year').add(9, 'month').format('YYYY-MM-DD')],
          label: 'Last year',
        },
        {
          value: [dayjs().startOf('quarter').format('YYYY-MM-DD'), dayjs().add(1, 'quarter').startOf('quarter').format('YYYY-MM-DD')],
          label: 'Next two quarters',
        },
      ]}
    />
  );
}

Controlling with useQuarterPickerInput

QuarterPickerInput component supports the controller pattern. Use the useQuarterPickerInput hook to manage QuarterPickerInput state. The controller does not own the selected value, keep using value and onChange for it. When the controller prop is set, the date, level and dropdown state props of the component are ignored, pass them to useQuarterPickerInput instead.

The dropdown resets the displayed date and level every time it opens. To open it on another level or date, call setLevel or setDate after openDropdown:

Dropdown closed, displayed year: none

import { useState } from 'react';
import { Button, Group, Stack, Text } from '@mantine/core';
import { QuarterPickerInput, useQuarterPickerInput } from '@mantine/dates';

function Demo() {
  const [value, setValue] = useState<string | null>('2024-04-01');
  const controller = useQuarterPickerInput();

  return (
    <Stack>
      <Group>
        <Button
          variant="default"
          onClick={() => {
            controller.openDropdown();
            controller.setLevel('decade');
          }}
        >
          Pick a year
        </Button>
        <Button
          variant="default"
          onClick={() => {
            controller.openDropdown();
            controller.next();
          }}
        >
          Open next year
        </Button>
        <Button
          variant="default"
          onClick={() => {
            controller.openDropdown();
            controller.setDate(new Date());
          }}
        >
          Open at today
        </Button>
      </Group>

      <QuarterPickerInput
        label="Pick quarter"
        placeholder="Pick quarter"
        value={value}
        onChange={setValue}
        controller={controller}
      />

      <Text size="sm" c="dimmed">
        Dropdown {controller.isDropdownOpened() ? 'opened' : 'closed'}, displayed{' '}
        {controller.getDisplayedLevel()}: {controller.getDisplayedDate() ?? 'none'}
      </Text>
    </Stack>
  );
}

Dropdown type

By default, the dropdown is a bottom Drawer below theme.breakpoints.sm and a popover above. Set dropdownType to popover, modal, drawer or an object with breakpoints. Use popoverProps, modalProps and drawerProps to pass props down to the underlying component:

import { Stack } from '@mantine/core';
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <Stack>
      <QuarterPickerInput dropdownType="drawer" label="Drawer" placeholder="Pick date" />
      <QuarterPickerInput dropdownType="modal" label="Modal" placeholder="Pick date" />
      <QuarterPickerInput dropdownType="popover" label="Popover" placeholder="Pick date" />
      <QuarterPickerInput
        dropdownType={{ base: 'drawer', 600: 'popover' }}
        label="Drawer below 600px, popover above"
        placeholder="Pick date"
      />
    </Stack>
  );
}

Submit button

In drawer and modal dropdowns, the value is applied when the submit button is pressed. Set applyOnSubmit={false} to apply the value on selection. Change the button label with the submitButtonLabel prop or the same DatesProvider setting, and pass other props with submitButtonProps:

import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <QuarterPickerInput
      dropdownType="drawer"
      applyOnSubmit={false}
      label="Applied on selection"
      placeholder="Pick date"
    />
  );
}

Value format

Use the valueFormat prop to change the dayjs format of the value label. The default format is [Q]Q YYYY, for example Q2 2026:

import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <QuarterPickerInput
      valueFormat="YYYY [Q]Q"
      type="multiple"
      label="Pick quarter"
      placeholder="Pick quarter"
    />
  );
}

Value formatter

valueFormatter formats the value label with a custom function. The same function is called for all type values, so check the value type inside it. Example with type="multiple":

import dayjs from 'dayjs';
import { useState } from 'react';
import { QuarterPickerInput, DateFormatter } from '@mantine/dates';

const formatter: DateFormatter = ({ type, date, locale, format }) => {
  if (type === 'multiple' && Array.isArray(date)) {
    if (date.length === 1) {
      return dayjs(date[0]).locale(locale).format(format);
    }

    if (date.length > 1) {
      return `${date.length} dates selected`;
    }

    return '';
  }

  return '';
};

function Demo() {
  const [value, setValue] = useState<string[]>([]);

  return (
    <QuarterPickerInput
      label="Pick 2 dates or more"
      placeholder="Pick 2 dates or more"
      value={value}
      onChange={setValue}
      type="multiple"
      valueFormatter={formatter}
    />
  );
}

Clearable

Set the clearable prop to display a clear button in the right section. The clear button is not displayed when the rightSection prop is set:

import dayjs from 'dayjs';
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <QuarterPickerInput
      clearable
      defaultValue={dayjs().format('YYYY-MM-DD')}
      label="Pick date"
      placeholder="Pick date"
    />
  );
}

Clear section mode

The clearSectionMode prop determines how the clear button and rightSection are rendered:

  • 'both' (default) – render both the clear button and rightSection
  • 'rightSection' – render only the user-supplied rightSection, ignore clear button
  • 'clear' – render only the clear button, ignore rightSection
import { CaretDownIcon } from '@phosphor-icons/react';
import { Stack } from '@mantine/core';
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <Stack>
      <QuarterPickerInput
        label="clearSectionMode='both' (default)"
        placeholder="Pick quarter"
        defaultValue="2026-04-01"
        clearable
        rightSection={<CaretDownIcon size={16} />}
        clearSectionMode="both"
      />

      <QuarterPickerInput
        label="clearSectionMode='rightSection'"
        placeholder="Pick quarter"
        defaultValue="2026-04-01"
        clearable
        rightSection={<CaretDownIcon size={16} />}
        clearSectionMode="rightSection"
      />

      <QuarterPickerInput
        label="clearSectionMode='clear'"
        placeholder="Pick quarter"
        defaultValue="2026-04-01"
        clearable
        rightSection={<CaretDownIcon size={16} />}
        clearSectionMode="clear"
      />
    </Stack>
  );
}

Disabled state

import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <QuarterPickerInput
      disabled
      label="Disabled"
      placeholder="Pick quarter"
      defaultValue="2026-04-01"
    />
  );
}

Min and max dates

Quarters that end before minDate or start after maxDate are disabled:

import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <QuarterPickerInput
      label="Pick quarter"
      placeholder="Pick quarter"
      defaultDate="2026-01-01"
      minDate="2026-04-01"
      maxDate="2027-07-01"
    />
  );
}

Max level

Set maxLevel to limit the level that can be reached by clicking on the header label:

import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return <QuarterPickerInput maxLevel="year" label="Pick quarter" placeholder="Pick quarter" />;
}

Input props

QuarterPickerInput component supports Input and Input.Wrapper component features and all button element props. The QuarterPickerInput documentation does not include all features supported by the component – see the Input documentation to learn about all available features.

Radius
Size
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <QuarterPickerInput
      placeholder="Pick date"
      label="Pick date"
      withAsterisk
    />
  );
}

With icon

import { useState } from 'react';
import { CalendarBlankIcon } from '@phosphor-icons/react';
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  const [value, setValue] = useState<string | null>(null);
  return (
    <QuarterPickerInput
      leftSection={<CalendarBlankIcon size={18} />}
      leftSectionPointerEvents="none"
      label="Pick date"
      placeholder="Pick date"
      value={value}
      onChange={setValue}
    />
  );
}

Native level select

import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  return (
    <QuarterPickerInput
      withNativeLevelSelect
      label="Pick quarter"
      placeholder="Pick quarter"
    />
  );
}

Get element ref

import { useRef } from 'react';
import { QuarterPickerInput } from '@mantine/dates';

function Demo() {
  const ref = useRef<HTMLButtonElement>(null);
  return <QuarterPickerInput ref={ref} />;
}

Accessibility

If QuarterPickerInput is used without the label prop, it will not be announced properly by screen readers:

import { QuarterPickerInput } from '@mantine/core';

// Inaccessible input – screen reader will not announce it properly
function Demo() {
  return <QuarterPickerInput />;
}

Set aria-label to make the input accessible. In this case the label will not be visible, but screen readers will announce it:

import { QuarterPickerInput } from '@mantine/core';

// Accessible input – it has aria-label
function Demo() {
  return <QuarterPickerInput aria-label="My input" />;
}

If the label prop is set, the input will be accessible and it is not required to set aria-label:

import { QuarterPickerInput } from '@mantine/core';

// Accessible input – it has associated label element
function Demo() {
  return <QuarterPickerInput label="My input" />;
}