Put one item for each preset range in the list, and use separators to group them.
revenue-period.tsx
DatePresets
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| overflow | "scroll""wrap" | "wrap" | |
| variant | "chips""list" | "list" | |
| class | string | — | |
| children | ReactNode | — | DatePresetsItem and DatePresetsSeparator parts. |
| value | DatePresetValue | — | The value on its own (controlled), when the root is not inside a calendar or picker, or to drive it yourself beside one. null matches a preset with a null value. |
| default | DatePresetValue | — | The first value on its own (uncontrolled). |
| on | — | Called on each pick with the preset value, also when the root sets a calendar or picker, and also on a press on the selected preset (so a popup that closes on it closes then too). Narrow it with isDateRange from #/lib/date-preset-math. | |
| min | DateValue | null | — | The first allowed date. Default: the minValue of the calendar or picker around it. |
| max | DateValue | null | — | The last allowed date. Default: the maxValue of the calendar or picker around it. |
| disabled | boolean | false | Disable every preset. A disabled calendar or picker around it does the same. |
| read | boolean | false | Show the value but ignore picks. A read-only calendar or picker around it does the same. |
| today | DateValue | — | The date that the value texts count from: a value in its year shows no year ("Oct 16 – 22"), other values show it ("Jan 1 – Dec 31, 2027"). Pass the date that built the presets (getDateRangePresets(today, …)), so the server and the browser print the same text. Default: today in the time zone of the calendar around it, read after hydration only. |
| allows | boolean | — | Allow a range preset that holds unavailable days (isDateUnavailable), as the React Aria prop of the same name allows such a range in the grid. Default: the prop of the Date Range Picker around it, else false: a range preset with an unavailable day is disabled. Set it to match a Range Calendar around it (its state does not expose the prop). |
| show | boolean | true | list only: show the value text on the end side of each row (default true). Turn it off when a field next to the list shows the value. Chips never show it, so the row stays short. |
| list | — | list only: the other React Aria ListBox props (shouldFocusWrap, onAction...). | |
| toggle | — | chips only: the other Base UI ToggleGroup props (loopFocus, orientation...). | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
DatePresetsItem
| Prop | Type | Default | Description |
|---|---|---|---|
| value | DatePresetValue | — | The preset: a date, a range ({ start, end }), or null (no date). |
| children | ReactNode | — | The label: "Last 7 days". Write it in the language of the page. |
| text | string | — | The label as plain text, for typing to find a row. Needed when children is not a string. |
| value | string | — | list only: the text of the value. Default: the value in the locale ("Oct 16 – 22"). |
| disabled | boolean | false | |
| class | string | — | |
| list | — | list only: the other React Aria ListBoxItem props. | |
| toggle | — | chips only: the other Base UI Toggle props. | |
DatePresetsSeparator
| 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<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | MouseEventHandler<HTMLElement> | — | |
| on | TouchEventHandler<HTMLElement> | — | |
| on | TouchEventHandler<HTMLElement> | — | |
| on | TouchEventHandler<HTMLElement> | — | |
| on | TouchEventHandler<HTMLElement> | — | |
| on | TouchEventHandler<HTMLElement> | — | |
| on | TouchEventHandler<HTMLElement> | — | |
| on | TouchEventHandler<HTMLElement> | — | |
| on | TouchEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | PointerEventHandler<HTMLElement> | — | |
| on | UIEventHandler<HTMLElement> | — | |
| on | UIEventHandler<HTMLElement> | — | |
| on | WheelEventHandler<HTMLElement> | — | |
| on | WheelEventHandler<HTMLElement> | — | |
| on | AnimationEventHandler<HTMLElement> | — | |
| on | AnimationEventHandler<HTMLElement> | — | |
| on | AnimationEventHandler<HTMLElement> | — | |
| on | AnimationEventHandler<HTMLElement> | — | |
| on | AnimationEventHandler<HTMLElement> | — | |
| on | AnimationEventHandler<HTMLElement> | — | |
| on | TransitionEventHandler<HTMLElement> | — | |
| on | TransitionEventHandler<HTMLElement> | — | |
| on | TransitionEventHandler<HTMLElement> | — | |
| on | TransitionEventHandler<HTMLElement> | — | |
| on | TransitionEventHandler<HTMLElement> | — | |
| on | TransitionEventHandler<HTMLElement> | — | |
| on | TransitionEventHandler<HTMLElement> | — | |
| on | TransitionEventHandler<HTMLElement> | — | |
| style | CSSProperties | — | The inline style for the element. |
| 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. | |
| orientation | "horizontal""vertical" | 'horizontal' | The orientation of the separator. |
| element | string | — | The HTML element type that will be used to render the separator. |
| class | string | — | |
Built with
Installs with Date Presets





