DatePicker
Une date, choisie au calendrier ou saisie au clavier.
La valeur est une chaîne AAAA-MM-JJ : un objet Date porte une heure et un fuseau dont une date d'échéance n'a que faire, et qui la décalent d'un jour selon l'endroit d'où on la lit.
Installation
bash
sia-ui add date-pickerOu par le paquet, sans rien copier :
tsx
import { DatePicker } from "@sia-ui/react-web";Props
| Prop | Type | Défaut | Description |
|---|---|---|---|
* cellRender | CalendarProps | — | |
* disabledDate | CalendarProps | — | |
* locale | CalendarProps | — | |
* showWeek | CalendarProps | — | |
allowClear | boolean | true | |
aria-describedby | string | — | |
aria-invalid | boolean | — | |
aria-label | string | — | |
aria-labelledby | string | — | |
aria-required | boolean | — | |
className | string | — | |
defaultValue | string | — | |
disabled | boolean | false | |
firstDayOfWeek | CalendarProps | 1 | |
formatValue | (value: string, locale: string) => ReactNode | — | |
id | string | — | |
invalid | boolean | false | |
max | string | — | |
min | string | — | |
name | string | — | |
onOpenChange | (open: boolean) => void | — | |
onValueChange | (value: string) => void | — | |
open | boolean | — | |
overlayProps | Partial<Omit<OverlayProps, "children" | "open" | "onOpenChange" | "anchorRef">> | — | Réglages du panneau flottant — décalage, marge au bord, classe. |
placeholder | string | — | Par défaut, « Sélectionner une date » de la locale SIA. |
placement | OverlayPlacement | bottom-start | |
renderExtraFooter | () => ReactNode | — | |
required | boolean | false | |
showToday | boolean | true | |
tone | ComponentTone | primary | |
value | string | — |
* obligatoire.
Voir aussi
- Le composant dans le catalogue — états, variantes, et bac à sable.
- La référence complète — tous les composants.