Put the header and the grid in the picker. The grid gives a function that returns one cell for each month.
invoice-month.tsx
MonthPicker
<fieldset>| Prop | Type | Default | Description |
|---|---|---|---|
| auto | boolean | — | Moves the focus to the selected month (or the first month) on mount. |
| disabled | boolean | — | Turns off the control: no focus, no edits, and the disabled look. |
| read | boolean | — | The user can focus and read the value, but cannot change it. |
| invalid | boolean | — | Shows the invalid look and sets aria-invalid. |
| labels | — | The words (MONTH_PICKER_LABELS). Keep the object stable. | |
| min | DateValue | null | — | The earliest month that can be picked: months that end before it are disabled. |
| max | DateValue | null | — | The latest month that can be picked: months that start after it are disabled. |
| is | — | Months that can take the focus but not the value (no data, closed): struck through. Gets day 1 of the month in the calendar of the value (Gregorian when there is none). | |
| focused | DateValue | — | A date in the year that the page shows (controlled). |
| default | DateValue | — | A date in the year that the page shows first. Default: the value, else today. With server rendering and no value, pass it from the request: the server clock can be in another year. |
| on | — | Called with day 1 of the new year (in the calendar of the locale) when the page turns. | |
| selection | "range""single" | — | single (default): one month. range: a start and an end month, with the band. |
| value | — | Day 1 of the selected month (controlled). Day 1 of the first and of the last month (controlled). | |
| default | — | ||
| on | — | Called on every pick, also a press on the month that is the value already. Called when the user picks the end month, also when the range is the same. | |
| ...props | <fieldset> attributes | — | Every other attribute goes to the <fieldset>, with a ref. |
MonthPickerHeader
<header>| Prop | Type | Default | Description |
|---|---|---|---|
| ...props | <header> attributes | — | Every other attribute goes to the <header>, with a ref. |
MonthPickerGrid
| Prop | Type | Default | Description |
|---|---|---|---|
| aria-label | string | — | Defines a string value that labels the current element. |
| aria-labelledby | string | — | Identifies the element (or elements) that labels the current element. |
| aria-describedby | string | — | Identifies the element (or elements) that describes the object. |
| aria-details | string | — | Identifies the element (or elements) that provide a detailed, extended description for the object. |
| id | string | — | The element's unique identifier. See MDN. |
| dir | string | — | |
| lang | string | — | |
| inert | boolean | — | |
| translate | "no""yes" | — | |
| suppress | boolean | — | A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs. |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | UIEventHandler<HTMLDivElement> | — | |
| on | UIEventHandler<HTMLDivElement> | — | |
| on | WheelEventHandler<HTMLDivElement> | — | |
| on | WheelEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | — | Handler that is called when the element receives focus. | |
| on | — | Handler that is called when the element loses focus. | |
| on | — | Handler that is called when the element's focus status changes. | |
| style | StyleOrFunction<ListBoxRenderProps> | — | The inline style for the element. A function may be provided to compute the style based on component state. |
| slot | string | null | — | A slot name for the component. Slots allow the component to receive props from a parent component. An explicit null value indicates that the local props completely override all props received from a parent. |
| render | — | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Requirements: - You must render the expected element type (e.g. if <button> is expected, you cannot render an <a>). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. | |
| auto | "first""last"boolean | — | Whether to auto focus the listbox or an option. |
| should | boolean | — | Whether focus should wrap around when the end/start is reached. |
| should | boolean | — | Whether selection should occur on press up instead of press down. |
| should | boolean | — | Whether options should be focused when the user hovers over them. |
| on | — | Handler that is called when a user performs an action on an item. The exact user event depends on the collection's selectionBehavior prop and the interaction modality. | |
| dependencies | readonly any[] | — | Values that should invalidate the item cache when using dynamic collections. |
| drag | DragAndDropHooks<object> | — | The drag and drop hooks returned by useDragAndDrop used to enable drag and drop behavior for the ListBox. |
| render | — | Provides content to display when there are no items in the list. | |
| orientation | "horizontal""vertical" | 'vertical' | The primary orientation of the items. Usually this is the direction that the collection scrolls. |
| class | string | — | |
| ref | Ref<HTMLDivElement> | — | The grid element. The component also uses it for the page motion. |
| children | — | A function from day 1 of a month (in the calendar of the locale) to a MonthPickerCell, for a labelSuffix or other content. Default: <MonthPickerCell date={date} />. | |
MonthPickerCell
| Prop | Type | Default | Description |
|---|---|---|---|
| href | string | — | A URL to link to. See MDN. |
| href | string | — | Hints at the human language of the linked URL. SeeMDN. |
| target | "_blank""_parent""_self""_top"string | — | The target window for the link. See MDN. |
| rel | string | — | The relationship between the linked resource and the current page. See MDN. |
| download | string | boolean | — | Causes the browser to download the linked URL. A string may be provided to suggest a file name. See MDN. |
| ping | string | — | A space-separated list of URLs to ping when the link is followed. See MDN. |
| referrer | """no-referrer""no-referrer-when-downgrade""origin""origin-when-cross-origin""same-origin""strict-origin""strict-origin-when-cross-origin""unsafe-url" | — | How much of the referrer to send when following the link. See MDN. |
| router | | — | Options for the configured client side router. |
| dir | string | — | |
| lang | string | — | |
| inert | boolean | — | |
| translate | "no""yes" | — | |
| suppress | boolean | — | A React-only flag that suppresses the warning React normally logs when an element's server-rendered content doesn't match the client render during hydration. See React docs. |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | MouseEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | TouchEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | PointerEventHandler<HTMLDivElement> | — | |
| on | UIEventHandler<HTMLDivElement> | — | |
| on | UIEventHandler<HTMLDivElement> | — | |
| on | WheelEventHandler<HTMLDivElement> | — | |
| on | WheelEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | AnimationEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | TransitionEventHandler<HTMLDivElement> | — | |
| on | — | Handler that is called when a key is pressed. | |
| on | — | Handler that is called when a key is released. | |
| on | — | Handler that is called when the element receives focus. | |
| on | — | Handler that is called when the element loses focus. | |
| on | — | Handler that is called when the element's focus status changes. | |
| on | — | Handler that is called when a hover interaction starts. | |
| on | — | Handler that is called when a hover interaction ends. | |
| on | — | Handler that is called when the hover state changes. | |
| on | — | Handler that is called when the press is released over the target. | |
| on | — | Handler that is called when a press interaction starts. | |
| on | — | Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target. | |
| on | — | Handler that is called when the press state changes. | |
| on | — | Handler that is called when a press is released over the target, regardless of whether it started on the target or not. | |
| on | — | **Not recommended – use onPress instead.** onClick is an alias for onPress provided for compatibility with other libraries. onPress provides additional event details for non-mouse interactions. | |
| style | StyleOrFunction<ListBoxItemRenderProps> | — | The inline style for the element. A function may be provided to compute the style based on component state. |
| render | — | Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components. Note: You can check if 'href' in props in order to tell whether to render an <a> element. Requirements: - You must render the expected element type (e.g. if <a> is expected, you cannot render a <button>). - Only a single root DOM element can be rendered (no fragments). - You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate. | |
| aria-label | string | — | An accessibility label for this item. |
| on | — | Handler that is called when a user performs an action on the item. The exact user event depends on the collection's selectionBehavior prop and the interaction modality. | |
| disabled | boolean | — | Turns off the control: no focus, no edits, and the disabled look. |
| date | CalendarDate | — | Day 1 of the month, in the calendar of the locale (from the MonthPickerGrid function). |
| class | string | — | |
| label | string | — | Words that the cell name adds after the month: "no usage data", "closed". |
| children | ReactNode | — | Replaces the short month name. The current-month dot stays after it. |
| Arrow keys | Move one month, or one row. Past an edge the year changes. |
|---|---|
| HomeorEnd | Go to the first or the last month. |
| Page UporPage Down | Go one year back or on. |
| Enter | Picks the focused month. |
Built with
Installs with Month Picker
- Components
- Button





