Skip to content

Date Presets

Free

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.

  • Base UI
  • React Aria
  • React 19
  • Tailwind CSS 4

Added Nov 9, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

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

revenue-period.tsx

DatePresets

<div>
PropTypeDefaultDescription
overflow"scroll""wrap""wrap"
variant"chips""list""list"
classNamestring—
childrenReactNode—DatePresetsItem and DatePresetsSeparator parts.
valueDatePresetValue—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.
defaultValueDatePresetValue—The first value on its own (uncontrolled).
onValueChange—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.
minValueDateValue | null—The first allowed date. Default: the minValue of the calendar or picker around it.
maxValueDateValue | null—The last allowed date. Default: the maxValue of the calendar or picker around it.
disabledbooleanfalseDisable every preset. A disabled calendar or picker around it does the same.
readOnlybooleanfalseShow the value but ignore picks. A read-only calendar or picker around it does the same.
todayDateValue—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.
allowsNonContiguousRangesboolean—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).
showValueTextbooleantruelist 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—list only: the other React Aria ListBox props (shouldFocusWrap, onAction...).
toggleGroupProps—chips only: the other Base UI ToggleGroup props (loopFocus, orientation...).
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

DatePresetsItem

PropTypeDefaultDescription
valueRequiredDatePresetValue—The preset: a date, a range ({ start, end }), or null (no date).
childrenRequiredReactNode—The label: "Last 7 days". Write it in the language of the page.
textValuestring—The label as plain text, for typing to find a row. Needed when children is not a string.
valueTextstring—list only: the text of the value. Default: the value in the locale ("Oct 16 – 22").
disabledbooleanfalse
classNamestring—
listBoxItemProps—list only: the other React Aria ListBoxItem props.
toggleProps—chips only: the other Base UI Toggle props.

DatePresetsSeparator

PropTypeDefaultDescription
aria-labelstring—Defines a string value that labels the current element.
aria-labelledbystring—Identifies the element (or elements) that labels the current element.
aria-describedbystring—Identifies the element (or elements) that describes the object.
aria-detailsstring—Identifies the element (or elements) that provide a detailed, extended description for the object.
idstring—The element's unique identifier. See MDN.
dirstring—
langstring—
hiddenboolean—
inertboolean—
translate"no""yes"—
suppressHydrationWarningboolean—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.
onClickMouseEventHandler<HTMLElement>—
onClickCaptureMouseEventHandler<HTMLElement>—
onAuxClickMouseEventHandler<HTMLElement>—
onAuxClickCaptureMouseEventHandler<HTMLElement>—
onContextMenuMouseEventHandler<HTMLElement>—
onContextMenuCaptureMouseEventHandler<HTMLElement>—
onDoubleClickMouseEventHandler<HTMLElement>—
onDoubleClickCaptureMouseEventHandler<HTMLElement>—
onMouseDownMouseEventHandler<HTMLElement>—
onMouseDownCaptureMouseEventHandler<HTMLElement>—
onMouseEnterMouseEventHandler<HTMLElement>—
onMouseLeaveMouseEventHandler<HTMLElement>—
onMouseMoveMouseEventHandler<HTMLElement>—
onMouseMoveCaptureMouseEventHandler<HTMLElement>—
onMouseOutMouseEventHandler<HTMLElement>—
onMouseOutCaptureMouseEventHandler<HTMLElement>—
onMouseOverMouseEventHandler<HTMLElement>—
onMouseOverCaptureMouseEventHandler<HTMLElement>—
onMouseUpMouseEventHandler<HTMLElement>—
onMouseUpCaptureMouseEventHandler<HTMLElement>—
onTouchCancelTouchEventHandler<HTMLElement>—
onTouchCancelCaptureTouchEventHandler<HTMLElement>—
onTouchEndTouchEventHandler<HTMLElement>—
onTouchEndCaptureTouchEventHandler<HTMLElement>—
onTouchMoveTouchEventHandler<HTMLElement>—
onTouchMoveCaptureTouchEventHandler<HTMLElement>—
onTouchStartTouchEventHandler<HTMLElement>—
onTouchStartCaptureTouchEventHandler<HTMLElement>—
onPointerDownPointerEventHandler<HTMLElement>—
onPointerDownCapturePointerEventHandler<HTMLElement>—
onPointerMovePointerEventHandler<HTMLElement>—
onPointerMoveCapturePointerEventHandler<HTMLElement>—
onPointerUpPointerEventHandler<HTMLElement>—
onPointerUpCapturePointerEventHandler<HTMLElement>—
onPointerCancelPointerEventHandler<HTMLElement>—
onPointerCancelCapturePointerEventHandler<HTMLElement>—
onPointerEnterPointerEventHandler<HTMLElement>—
onPointerLeavePointerEventHandler<HTMLElement>—
onPointerOverPointerEventHandler<HTMLElement>—
onPointerOverCapturePointerEventHandler<HTMLElement>—
onPointerOutPointerEventHandler<HTMLElement>—
onPointerOutCapturePointerEventHandler<HTMLElement>—
onGotPointerCapturePointerEventHandler<HTMLElement>—
onGotPointerCaptureCapturePointerEventHandler<HTMLElement>—
onLostPointerCapturePointerEventHandler<HTMLElement>—
onLostPointerCaptureCapturePointerEventHandler<HTMLElement>—
onScrollUIEventHandler<HTMLElement>—
onScrollCaptureUIEventHandler<HTMLElement>—
onWheelWheelEventHandler<HTMLElement>—
onWheelCaptureWheelEventHandler<HTMLElement>—
onAnimationStartAnimationEventHandler<HTMLElement>—
onAnimationStartCaptureAnimationEventHandler<HTMLElement>—
onAnimationEndAnimationEventHandler<HTMLElement>—
onAnimationEndCaptureAnimationEventHandler<HTMLElement>—
onAnimationIterationAnimationEventHandler<HTMLElement>—
onAnimationIterationCaptureAnimationEventHandler<HTMLElement>—
onTransitionCancelTransitionEventHandler<HTMLElement>—
onTransitionCancelCaptureTransitionEventHandler<HTMLElement>—
onTransitionEndTransitionEventHandler<HTMLElement>—
onTransitionEndCaptureTransitionEventHandler<HTMLElement>—
onTransitionRunTransitionEventHandler<HTMLElement>—
onTransitionRunCaptureTransitionEventHandler<HTMLElement>—
onTransitionStartTransitionEventHandler<HTMLElement>—
onTransitionStartCaptureTransitionEventHandler<HTMLElement>—
styleCSSProperties—The inline style for the element.
slotstring | 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.
elementTypestring—The HTML element type that will be used to render the separator.
classNamestring—
  • Use it when most people pick the same few dates.
  • Use variant="chips" above a Calendar, and the list beside a Range Calendar.
  • For any day of the month, use a Calendar.
Check mark
fade · the check of the picked row fades in

Built with

Installs with Date Presets

Components
Button,Scroller
  1. AddedDate Presets, with Button, Scroller.
Open the release