MonthPicker
Un mes de un año: «noviembre 2026». El valor es «2026-11». Para informes y periodos de facturación.
import { MonthPicker } from '@sypnia/ui/react'
En esta página
Un periodo de factura
Saved as 2026-10
Código
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>;
} Cuándo usarlo
Úsalo cuando
- Periodos que son meses completos.
No lo uses cuando
- Un día específico: usa DatePicker.
Para todos
- Los meses son botones con mes y año como nombre; el elegido queda pulsado.
Props
| MonthPicker | Tipo | Por defecto |
|---|---|---|
onChangeobligatorio | (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 |