Ir al contenido

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
  1. Un periodo de factura
  2. Cuándo usarlo
  3. Para todos
  4. Props

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

MonthPickerTipoPor defecto
onChangeobligatorio (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. Un periodo de factura
  2. Cuándo usarlo
  3. Para todos
  4. Props

    Busca páginas, secciones y términos