Skip to content

MonthPicker

A month of a year: «November 2026». The value is «2026-11». For reports and billing periods.

import { MonthPicker } from '@sypnia/ui/react'

On this page
  1. An invoice period
  2. When to use it
  3. For everyone
  4. Props

An invoice period

Saved as 2026-10

Code
import { useState } from 'react';
import { Field, MonthPicker } from '@sypnia/ui/react';

// A month of a year, for reports and invoices. Months after November 2026 cannot be chosen yet.
export default function Period() {
  const [month, setMonth] = useState('2026-10');
  return <Field label="Invoice period" hint={`Saved as ${month}`}><MonthPicker value={month} onChange={setMonth} max="2026-11" /></Field>;
}

When to use it

Use it when

  • Periods that are whole months.

Do not use it when

  • A specific day: use DatePicker.

For everyone

  • The months are buttons named with month and year; the chosen one is pressed.

Props

MonthPickerTypeDefault
onChangerequired (month: string) => void
aria-describedby string
aria-label

The name for screen readers when there is no Field around it.

string
aria-labelledby string
className string
disabled boolean
id

Inside a Field it comes from the Field.

string
invalid

Marks the value as wrong. Inside a `<Field error>` it is set for you.

boolean
max string
min string
value string
  1. An invoice period
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms