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
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
| MonthPicker | Type | Default |
|---|---|---|
onChangerequired | (month: string) => void | |
aria-describedby | string | |
aria-labelThe name for screen readers when there is no Field around it. | string | |
aria-labelledby | string | |
className | string | |
disabled | boolean | |
idInside a Field it comes from the Field. | string | |
invalidMarks the value as wrong. Inside a `<Field error>` it is set for you. | boolean | |
max | string | |
min | string | |
value | string |