Inputs
Date Field
A date field on the native input: the calendar, the locale and the phone's system picker all come from the browser.
- date
- native
- form
- calendar
Preview
1440pxHost theme
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this in the header: https://vibeui.ru/c/date-001?lang=en
Dates through the end of September.
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 "date-001" (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/date-001.json
Registry item: https://vibeui.ru/r/date-001.json
Installs to: components/vibeui/date-001.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, the locale and the phone's system picker all come from the browser.
A date field: a label, the native calendar and a note about the available days. Zero dependencies, one file, no client JS.
## 3. How to use it
import { Date001 } from "@/components/vibeui/date-001"
<Date001 label="Travel date" min="2026-08-31" max="2026-09-30" />
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-date-001-* palette — do not swap it for your theme tokens
- its own light surface: the field gets shown over any background
- the native input[type=date]: locale, keyboard and the phone picker come free
- min and max: the browser rejects unavailable dates instead of a post-submit check
- the aria-describedby link between field and note
- the calendar icon — recolour it, do not hide it
- the YYYY-MM-DD value format: display follows the system, the value does not
## 6. You may change
- label, hint and name
- defaultValue, min and max
- the accent through the accent prop
- the field width
## 7. Rules
- The browser calendar cannot be styled: for a custom look use calendar-001.
- Field bounds do not replace server validation — they are trivial to bypass.
- The note is about available days, not the format: the user never types the format.
- 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/date-001.jsonhttps://vibeui.ru/r/date-001.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-date-001-*. Серверный: хуков нет. Значение хранится в формате ГГГГ-ММ-ДД, а показывается по настройкам системы. Границы заданы min и max, поэтому недоступные даты отсекает сам браузер, а пояснение связано с полем через aria-describedby.
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
import type { ComponentPropsWithoutRef, CSSProperties } from "react"
export type Date001Props = Omit<
ComponentPropsWithoutRef<"div">,
"children" | "defaultValue"
> & {
label?: string
hint?: string
defaultValue?: string
min?: string
max?: string
name?: string
accent?: string
}
// Идея компонента: поле даты на нативном input[type=date]. Свой календарь
// пришлось бы учить локалям, часовым поясам и клавиатуре, а нативный уже знает
// их и на телефоне открывает системный выбор. Значение всегда в формате
// ГГГГ-ММ-ДД, а показывается по настройкам системы — подпись поясняет границы,
// а не формат, потому что формат пользователь не набирает вручную.
const STYLES = `
:where([data-vibeui-block="date-001"]){
--vibeui-date-001-bg:oklch(1 0 0);
--vibeui-date-001-surface:oklch(1 0 0);
--vibeui-date-001-shell:oklch(0.9 0.006 265);
--vibeui-date-001-fg:oklch(0.24 0.014 265);
--vibeui-date-001-muted:oklch(0.56 0.014 265);
--vibeui-date-001-border:oklch(0.88 0.008 265);
--vibeui-date-001-accent:oklch(0.55 0.2 262);
--vibeui-date-001-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Своя светлая подложка: поле показывают поверх любого фона. */
[data-vibeui-block="date-001"]{
display:flex;flex-direction:column;gap:0.375rem;
padding:0.875rem;
background:var(--vibeui-date-001-surface);
border:1px solid var(--vibeui-date-001-shell);border-radius:0.875rem;
width:100%;max-width:18rem;box-sizing:border-box;
font-family:var(--vibeui-date-001-font);color:var(--vibeui-date-001-fg);
}
[data-vibeui-block="date-001"] label{font-size:0.8125rem;font-weight:600}
[data-vibeui-block="date-001"] input{
width:100%;box-sizing:border-box;height:2.5rem;padding:0 0.75rem;
background:var(--vibeui-date-001-bg);color:inherit;
border:1px solid var(--vibeui-date-001-border);border-radius:0.625rem;
font:inherit;font-size:0.875rem;
}
[data-vibeui-block="date-001"] input:focus-visible{outline:2px solid var(--vibeui-date-001-accent);outline-offset:1px;border-color:var(--vibeui-date-001-accent)}
/* Иконка календаря — часть контрола: перекрашиваем, а не прячем. */
[data-vibeui-block="date-001"] input::-webkit-calendar-picker-indicator{cursor:pointer;opacity:.55}
[data-vibeui-block="date-001"] input::-webkit-calendar-picker-indicator:hover{opacity:1}
[data-vibeui-block="date-001"] [data-part="hint"]{margin:0;font-size:0.75rem;line-height:1.4;color:var(--vibeui-date-001-muted)}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="date-001"] *{animation:none!important;transition:none!important}}
`
/**
* Поле даты на нативном input[type=date]: календарь, локаль и клавиатура даром.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Date001({
label = "Дата поездки",
hint = "Доступны даты до конца сентября.",
defaultValue = "2026-09-12",
min = "2026-08-31",
max = "2026-09-30",
name = "trip-date",
accent,
className,
style,
...props
}: Date001Props) {
const palette = {
...(accent ? { "--vibeui-date-001-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-date-001" precedence="medium">
{STYLES}
</style>
<div
{...props}
data-vibeui-block="date-001"
className={className}
style={palette}
>
<label htmlFor={`${name}-input`}>{label}</label>
<input
id={`${name}-input`}
name={name}
type="date"
defaultValue={defaultValue}
min={min}
max={max}
aria-describedby={hint ? `${name}-hint` : undefined}
/>
{hint ? (
<p id={`${name}-hint`} data-part="hint">
{hint}
</p>
) : null}
</div>
</>
)
}