跳至正文

Date Picker

A styled native date input that keeps the browser's picker and validation.

浏览器
Chrome 123+Firefox 121+Safari 17.5+
层级
0
强制布局预算
0 ms
axe 预算
0
支持 SSR
是
公开契约
测试环境

交互示例

Date Picker

默认

示例

Native date input

The browser owns date entry, constraints, locale and picker UI; provide a visible label.

Date Picker

Default

import { DatePicker } from "@gunkin/uiify";

export default function Example() {
  return (
    <div>
      <label htmlFor="start-date">Start date</label>
      <DatePicker id="start-date" name="startDate" defaultValue="2026-10-19" />
    </div>
  );
}

API

DatePicker

属性类型默认值说明
typefixed to "date"—Fixed native input type; the browser supplies the date picker.
invalidbooleanfalseSets aria-invalid and data-invalid when true.
id / name / value / defaultValue / min / max / required / disablednative input props—Native date input props and form behavior are preserved.
className / style / ref / eventsnative input props—Native input props, styles, events, and ref are forwarded.

键盘

按键操作

无障碍

Direct native input type=date wrapper. Provide a visible label and use native required, min, and max constraints. The browser owns date entry, locale, keyboard behavior, and picker UI; UIify does not format values, convert time zones, or provide a calendar grid. invalid sets aria-invalid and data-invalid.

样式钩子

data-uiify-date-pickerdata-invalid