Calendar

Native Date Field

A date field on the native input: the calendar, format and mobile wheel come from the system, and the limits are spelled out.

  • calendar
  • input
  • native
  • form

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.

put this in the header: https://vibeui.ru/c/calendar-005?lang=en

Any date from 1 March to 31 December 2026

Show the full instructions

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

# Install and place "calendar-005" (Native Date Field) from VibeUI

## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/calendar-005.json

Registry item: https://vibeui.ru/r/calendar-005.json
Installs to: components/vibeui/calendar-005.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.

Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.

## 2. What it is
A date field on the native input: the calendar, format and mobile wheel come from the system, and the limits are spelled out.

A date field on a native input type="date": the system calendar, the local format, min and max limits and a worded explanation. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Calendar005 } from "@/components/vibeui/calendar-005"

<Calendar005 label="Travel date" min="2026-03-01" max="2026-12-31" />

Read the installed file for the full prop list.

## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.

Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)

## 5. Keep exactly as installed
- the local --vibeui-calendar-005-* palette — do not swap it for your theme tokens
- the native input: a custom widget would need translating and fixing per browser
- the label tied to the field through useId
- explaining min and max in words: a greyed day in the system picker gives no reason
- the aria-describedby linking field and explanation
- the thumb-sized field height

## 6. You may change
- label and defaultValue
- min and max — the allowed range
- hint — the explanation of the limits
- the accent through the accent prop

## 7. Rules
- The picker's look belongs to the browser and OS: it differs on iOS, Android and Firefox.
- The value arrives as YYYY-MM-DD regardless of how it is displayed.
- min and max are hints, not protection: validate the date on the server.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.

## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.

For developers

npx shadcn@latest add https://vibeui.ru/r/calendar-005.json
https://vibeui.ru/r/calendar-005.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-calendar-005-*. Серверный компонент: useId нужен только для связи подписи и поля. Внутри input type="date" с min и max; ограничения продублированы текстом через aria-describedby. Стилизуется только штатный значок календаря — остальное у input date недоступно.

Component source

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

import { useId } from "react"
import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type Calendar005Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children" | "defaultValue"
> & {
  label?: string
  defaultValue?: string
  min?: string
  max?: string
  hint?: string
  accent?: string
}

// Идея компонента: поле даты на нативном input type="date". Календарь,
// клавиатура, локальный формат и мобильный барабан приходят от системы —
// свой виджет пришлось бы переводить на все языки и чинить в каждом
// браузере. Ограничения min и max объявлены и словами: серый день в
// системном календаре не объясняет, почему он недоступен.
const STYLES = `
:where([data-vibeui-block="calendar-005"]){
--vibeui-calendar-005-bg:oklch(1 0 0);
--vibeui-calendar-005-fg:oklch(0.24 0.014 265);
--vibeui-calendar-005-muted:oklch(0.58 0.014 265);
--vibeui-calendar-005-border:oklch(0.91 0.006 265);
--vibeui-calendar-005-field:oklch(0.985 0.002 265);
--vibeui-calendar-005-accent:oklch(0.55 0.17 265);
--vibeui-calendar-005-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="calendar-005"]{
display:flex;flex-direction:column;gap:0.375rem;
width:100%;max-width:18rem;box-sizing:border-box;padding:0.875rem;
background:var(--vibeui-calendar-005-bg);
border:1px solid var(--vibeui-calendar-005-border);border-radius:0.875rem;
color:var(--vibeui-calendar-005-fg);font-family:var(--vibeui-calendar-005-font);
}
[data-vibeui-block="calendar-005"] label{font-size:0.8125rem;font-weight:600}
[data-vibeui-block="calendar-005"] input{
box-sizing:border-box;width:100%;height:2.5rem;padding:0 0.75rem;
border:1px solid var(--vibeui-calendar-005-border);border-radius:0.625rem;
background:var(--vibeui-calendar-005-field);color:inherit;
font:inherit;font-size:0.875rem;font-variant-numeric:tabular-nums;
}
[data-vibeui-block="calendar-005"] input:focus-visible{
outline:2px solid var(--vibeui-calendar-005-accent);outline-offset:1px;border-color:transparent;
}
/* Штатный значок календаря — единственное, что можно тронуть у input date:
   красим его в цвет текста, чтобы он не выглядел чужим. */
[data-vibeui-block="calendar-005"] input::-webkit-calendar-picker-indicator{
cursor:pointer;opacity:.55;
}
[data-vibeui-block="calendar-005"] input::-webkit-calendar-picker-indicator:hover{opacity:.85}
[data-vibeui-block="calendar-005"] [data-part="hint"]{font-size:0.75rem;line-height:1.4;color:var(--vibeui-calendar-005-muted)}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="calendar-005"] *{animation:none!important;transition:none!important}}
`

/**
 * Поле даты на нативном input: календарь и формат берутся у системы.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Calendar005({
  label = "Дата поездки",
  defaultValue = "2026-03-17",
  min = "2026-03-01",
  max = "2026-12-31",
  hint = "Можно выбрать с 1 марта по 31 декабря 2026 года",
  accent,
  className,
  style,
  ...props
}: Calendar005Props) {
  const id = useId()
  const palette = {
    ...(accent ? { "--vibeui-calendar-005-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-calendar-005" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="calendar-005"
        className={className}
        style={palette}
      >
        <label htmlFor={id}>{label}</label>
        <input
          id={id}
          type="date"
          defaultValue={defaultValue}
          min={min}
          max={max}
          aria-describedby={hint ? `${id}-hint` : undefined}
        />
        {hint ? (
          <p data-part="hint" id={`${id}-hint`}>
            {hint}
          </p>
        ) : null}
      </div>
    </>
  )
}