Calendar

Capped Range

A range with a hard cap of N days: once the first date is picked the unreachable days go dim, and the counter below shows how much of the limit is left.

What you can change

  • month — the displayed month as a YYYY-MM string
  • maxDays — the maximum range length in days
  • defaultFrom and defaultTo — the bounds 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-030?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-030-*. Client-side: both bounds of the range live in useState. The limit is expressed not by an error message but by the state of the grid: while only the first date is selected, the blocked function dims the days earlier than the start and further than maxDays-1 through the native disabled, so the ban is announced to a screen reader too. The number of grid rows is computed as Math.ceil((offset+days)/7)*7, so the month does not leave an empty sixth week. The progress bar under the grid is filled by the variable --vibeui-calendar-030-fill from the ratio of the range length to the limit. The total is declined through pluralize and announced through aria-live. 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 captions arrive in the text dictionary with the substitutions {max}, {count} and {unit}; the substitution returns nodes, so the numbers stay inside <b> and the word order is set by the translation.

Tags

  • calendar
  • range
  • limit
  • booking
Component source

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

Loading…