---
title: "Date Presets"
description: "One-press picks such as Last 7 days or Next Monday, as a list or as chips. A pick sets the calendar or the date picker next to it."
url: https://gelatinui.com/components/date-presets
markdown_url: https://gelatinui.com/components/date-presets.md
access: free
install: "npx shadcn@latest add @gelatin-ui/date-presets"
registry_item: https://gelatinui.com/r/date-presets.json
version: "2026-11-09"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Date Presets

> One-press picks such as Last 7 days or Next Monday, as a list or as chips. A pick sets the calendar or the date picker next to it.

Page: https://gelatinui.com/components/date-presets

## When to use it

Best for: One press on the most common dates, beside a calendar or a date picker.

- Use it when most people pick the same few dates.
- Use `variant="chips"` above a Calendar, and the list beside a Range Calendar.

## When not to use it

- For any day of the month, use a [Calendar](https://gelatinui.com/components/calendar.md).

## Notes for agents

- Put it inside the Calendar, Range Calendar, Date Picker, or Date Range Picker root, and a pick sets their value.
- Get the preset values from `getSingleDatePresets` or `getDateRangePresets` in `lib/date-preset-math`.
- A preset outside `minValue` or `maxValue` is disabled.

## Anatomy

```text
DatePresets
├─ DatePresetsItem (0..n)
└─ DatePresetsSeparator (0..n)
```

## API reference

### DatePresets

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `overflow` | `"scroll" \| "wrap"` | "wrap" |  |
| `variant` | `"chips" \| "list"` | "list" |  |
| `className` | `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. |
| `defaultValue` | `DatePresetValue` |  | The first value on its own (uncontrolled). |
| `onValueChange` | `function` |  | 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`. |
| `minValue` | `DateValue \| null` |  | The first allowed date. Default: the `minValue` of the calendar or picker around it. |
| `maxValue` | `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. |
| `readOnly` | `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. |
| `allowsNonContiguousRanges` | `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). |
| `showValueText` | `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. |
| `listBoxProps` | `Omit` |  | `list` only: the other React Aria `ListBox` props (`shouldFocusWrap`, `onAction`...). |
| `toggleGroupProps` | `Omit` |  | `chips` only: the other Base UI `ToggleGroup` props (`loopFocus`, `orientation`...). |

### 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. |
| `textValue` | `string` |  | The label as plain text, for typing to find a row. Needed when `children` is not a string. |
| `valueText` | `string` |  | `list` only: the text of the value. Default: the value in the locale ("Oct 16 – 22"). |
| `disabled` | `boolean` | false |  |
| `className` | `string` |  |  |
| `listBoxItemProps` | `Omit` |  | `list` only: the other React Aria `ListBoxItem` props. |
| `toggleProps` | `Omit` |  | `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` |  |  |
| `hidden` | `boolean` |  |  |
| `inert` | `boolean` |  |  |
| `translate` | `"no" \| "yes"` |  |  |
| `suppressHydrationWarning` | `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. |
| `onClick` | `MouseEventHandler<HTMLElement>` |  |  |
| `onClickCapture` | `MouseEventHandler<HTMLElement>` |  |  |
| `onAuxClick` | `MouseEventHandler<HTMLElement>` |  |  |
| `onAuxClickCapture` | `MouseEventHandler<HTMLElement>` |  |  |
| `onContextMenu` | `MouseEventHandler<HTMLElement>` |  |  |
| `onContextMenuCapture` | `MouseEventHandler<HTMLElement>` |  |  |
| `onDoubleClick` | `MouseEventHandler<HTMLElement>` |  |  |
| `onDoubleClickCapture` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseDown` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseDownCapture` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseEnter` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseLeave` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseMove` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseMoveCapture` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseOut` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseOutCapture` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseOver` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseOverCapture` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseUp` | `MouseEventHandler<HTMLElement>` |  |  |
| `onMouseUpCapture` | `MouseEventHandler<HTMLElement>` |  |  |
| `onTouchCancel` | `TouchEventHandler<HTMLElement>` |  |  |
| `onTouchCancelCapture` | `TouchEventHandler<HTMLElement>` |  |  |
| `onTouchEnd` | `TouchEventHandler<HTMLElement>` |  |  |
| `onTouchEndCapture` | `TouchEventHandler<HTMLElement>` |  |  |
| `onTouchMove` | `TouchEventHandler<HTMLElement>` |  |  |
| `onTouchMoveCapture` | `TouchEventHandler<HTMLElement>` |  |  |
| `onTouchStart` | `TouchEventHandler<HTMLElement>` |  |  |
| `onTouchStartCapture` | `TouchEventHandler<HTMLElement>` |  |  |
| `onPointerDown` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerDownCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerMove` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerMoveCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerUp` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerUpCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerCancel` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerCancelCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerEnter` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerLeave` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerOver` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerOverCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerOut` | `PointerEventHandler<HTMLElement>` |  |  |
| `onPointerOutCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onGotPointerCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onGotPointerCaptureCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onLostPointerCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onLostPointerCaptureCapture` | `PointerEventHandler<HTMLElement>` |  |  |
| `onScroll` | `UIEventHandler<HTMLElement>` |  |  |
| `onScrollCapture` | `UIEventHandler<HTMLElement>` |  |  |
| `onWheel` | `WheelEventHandler<HTMLElement>` |  |  |
| `onWheelCapture` | `WheelEventHandler<HTMLElement>` |  |  |
| `onAnimationStart` | `AnimationEventHandler<HTMLElement>` |  |  |
| `onAnimationStartCapture` | `AnimationEventHandler<HTMLElement>` |  |  |
| `onAnimationEnd` | `AnimationEventHandler<HTMLElement>` |  |  |
| `onAnimationEndCapture` | `AnimationEventHandler<HTMLElement>` |  |  |
| `onAnimationIteration` | `AnimationEventHandler<HTMLElement>` |  |  |
| `onAnimationIterationCapture` | `AnimationEventHandler<HTMLElement>` |  |  |
| `onTransitionCancel` | `TransitionEventHandler<HTMLElement>` |  |  |
| `onTransitionCancelCapture` | `TransitionEventHandler<HTMLElement>` |  |  |
| `onTransitionEnd` | `TransitionEventHandler<HTMLElement>` |  |  |
| `onTransitionEndCapture` | `TransitionEventHandler<HTMLElement>` |  |  |
| `onTransitionRun` | `TransitionEventHandler<HTMLElement>` |  |  |
| `onTransitionRunCapture` | `TransitionEventHandler<HTMLElement>` |  |  |
| `onTransitionStart` | `TransitionEventHandler<HTMLElement>` |  |  |
| `onTransitionStartCapture` | `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` | `DOMRenderFunction` |  | 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` | `Orientation` | 'horizontal' | The orientation of the separator. |
| `elementType` | `string` |  | The HTML element type that will be used to render the separator. |
| `className` | `string` |  |  |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| DatePresets | `date-presets` | `data-focus-visible`, `data-hovered` |  |  |
| DatePresetsItem | `date-presets-item` | `data-disabled`, `data-focus-visible`, `data-hovered`, `data-pressed`, `data-readonly`, `data-selected` |  | `motion-timing` |
| DatePresetsSeparator | `date-presets-separator` |  |  |  |

## Usage

Put one item for each preset range in the list, and use separators to group them.

```tsx title="revenue-period.tsx"
"use client";

import { parseDate } from "@internationalized/date";
import { useState } from "react";

import { DatePresets, DatePresetsItem, DatePresetsSeparator } from "@/components/ui/date-presets";
import { getDateRangePresets } from "@/lib/date-preset-math";
import type { DatePresetValue } from "@/lib/date-preset-math";

const RANGES = getDateRangePresets(parseDate("2026-11-12"), "en-US");

export function RevenuePeriod() {
  const [period, setPeriod] = useState<DatePresetValue>(RANGES.last30Days);
  return (
    <DatePresets aria-label="Revenue period" value={period} onValueChange={setPeriod}>
      <DatePresetsItem value={RANGES.today}>Today</DatePresetsItem>
      <DatePresetsItem value={RANGES.last7Days}>Last 7 days</DatePresetsItem>
      <DatePresetsItem value={RANGES.last30Days}>Last 30 days</DatePresetsItem>
      <DatePresetsSeparator />
      <DatePresetsItem value={RANGES.thisMonth}>This month</DatePresetsItem>
      <DatePresetsItem value={RANGES.lastMonth}>Last month</DatePresetsItem>
      <DatePresetsItem value={RANGES.thisQuarter}>This quarter</DatePresetsItem>
    </DatePresets>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/date-presets
```

It adds 35 registry items: 31 files, 5990 lines, and the npm packages `@base-ui/react`, `@internationalized/date`, `@mantine/hooks`, `@phosphor-icons/react`, `clsx`, `motion`, `react-aria-components`, `tailwind-merge`, `tailwind-variants`.

## Built on

- [Button](https://gelatinui.com/components/button.md)
- [Scroller](https://gelatinui.com/components/scroller.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Calendar](https://gelatinui.com/components/calendar.md)
- [Range Calendar](https://gelatinui.com/components/range-calendar.md)
- [Date Range Picker](https://gelatinui.com/components/date-range-picker.md)

## Motion

| Part | Motion |
| --- | --- |
| Check mark | fade · the check of the picked row fades in |
