Calendar

Range Presets

A reporting period chosen by preset — “last 7 days”, “previous month” and four more — with two date fields below showing what the preset expanded into.

What you can change

  • label — the heading above the presets
  • today — the reference date every preset is measured from
  • defaultPreset — the preset selected at first render

A link for your AI agent: preview, code and instructions.

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.
AI
1Pick it here

put this on the home page as the hero:

https://vibeui.ru/c/calendar-027?lang=en&theme=dark

2Paste into the chat
3Get it in your project

Not sure where to paste it? Step-by-step guide

Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

Loading…

For developers

The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.

Technical notes

The component is self-contained: one file, zero dependencies, its own palette in local variables --vibeui-calendar-027-*. Client-side: the selected preset and both bounds live in useState. The presets are expanded by the pure function resolve from the today reference date, which arrives as a prop — Date.now() inside the component would split the server and the client render. The date fields are native input type="date" with mutual min and max, so the browser itself does not let the period be reversed; editing by hand moves the choice into the custom state. The total counts the number of days inclusive and declines it through pluralize, while an invalid period (the end earlier than the start) is shown as separate text on a muted backing. The theme comes from the surrounding color-scheme through light-dark(): the component has no surface of its own by default, it sits directly on the page background and darkens along with it, while the background prop brings the panel back. The preset, field and total captions arrive in props, the Russian values sit in the defaults.

Tags

  • calendar
  • range
  • presets
  • reports
Component source

The same file your agent installs. Here in case you would rather copy it by hand.

Loading…