Calm motion: animations on this site only fade, with no movement
Preset range
A date range with presets, such as the last 7 days, next to a calendar
Lets a person pick a common range in one click, or any range on the calendar. It fits the filters of a report or a dashboard. For a date range field that opens on click, use the date picker.
Basic
Nov 10, 2026 – Nov 16, 2026
November 2026
MonTueWedThuFriSatSun
v-modelis the range as[start, end], each asYYYY-MM-DD.- The common presets are today, yesterday, the last 7 days, the last 30 days, this month, and last month.
presetsputs your own list in their place, each with alabeland arange. - The common presets need today.
todaysets it. Without it, the presets use today of the reader and show after the page loads. - The preset that matches the range has a bar and bold words. A preset in another month opens the calendar on that month.
- The line above the calendar says the range in words, such as
Nov 10, 2026 – Nov 16, 2026. It is a status line, so screen readers hear the change.localesets the language, andweek-startthe first day of the week. - The presets are toggle buttons in a group. Change the words with
labelsor a label pack:presets,today,yesterday,last7,last30,thisMonth,lastMonth, andnone.
Usage
ts
import { BlessPresetRange } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
presets | BlessRangePreset[] | — | your own presets in place of the common ones |
today | string | — | today, as YYYY-MM-DD; default: today of the reader, after mount |
locale | string | "en" | |
weekStart | 0 | 1 | 1 | |
labels | Partial<{ presets: string; today: string; yesterday: string; last7: string; last30: string; thisMonth: string; lastMonth: string; none: string; }> | — | |
modelValue | [string, string] | — | the range as [start, end], YYYY-MM-DD |
Events
| Name | Payload | Description |
|---|---|---|
update:modelValue | [value: [string, string] | undefined] |