Calendar Date Picker · Pattern 25
Loading preview...
Component
安装 Installation
用法 Usage
className 与 variant、size 可以一起用。字段以 timkit agent inspect date-picker --json 的 props 为准。
示例
一次看一个示例。左侧按名称筛选,预览里可切换源码和框架。
4 / 4
结构化 API
与 UCS schema 对齐的 props、逻辑机与多框架运行时。
Component
date-picker
Logic
zag / date-picker
Runtime Frameworks
Supported Platforms
| Prop | Type | Default | Description |
|---|---|---|---|
| logic.provider* | enum (zag | native | none) | zag | State and interaction provider used by this component. |
| logic.machine | string | date-picker | Underlying state machine identifier when provider is zag. |
| platforms* | array | Web, WeChat Mini Program | Platforms officially supported by this schema. |
| frameworks* | array | React, Vue, Weapp, HTML | Framework demos/code currently available in registry files. |
| dependencies | array | @timui/core, @zag-js/popper, @zag-js/react | Runtime package dependencies required by this registry item. |
| optionalPeerDependencies | array | @internationalized/date | Optional peer dependencies used by this registry item. |
| registryDependencies | array | calendar, popover, button | Dependent Timkit registry components/hook entries. |
| Prop | Type | Default | Description |
|---|---|---|---|
| mode | enum (single | range) | single | The selection mode. |
| numberOfMonths | number | 1 | The number of months to display. |
| value | array | - | The controlled selected dates. |
| placeholder | string | - | The button placeholder. |
| disabled | boolean | false | When true, opening and date changes are ignored. |
| readOnly | boolean | false | When true, the calendar can be opened and days can be focused, but selection does not change. |
| required | boolean | false | When true, the date picker is announced as required. |
| open | boolean | - | The controlled open state of the calendar. |
| defaultOpen | boolean | - | The default open state of the calendar when uncontrolled. |
| Prop | Type | Default | Description |
|---|---|---|---|
| onValueChange | event | - | Event handler called when the selected dates change. |
| onOpenChange | event | - | Event handler called when the calendar open state changes. |
来自 TypeScript 导出。
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | - | A unique identifier for the component. |
| modelValue | DatePickerVueValue | null | - | The controlled value bound via `v-model` (Vue specific). |
| defaultValue | DatePickerVueValue | - | The default value of the component when uncontrolled. |
| minDate | Date | - | The minimum allowed date. |
| maxDate | Date | - | The maximum allowed date. |
| locale | string | - | BCP 47 locale used for parsing/formatting date labels. |
| name | string | - | The name of the hidden input when used in a form. |
| isDateUnavailable | event | - | Callback to determine whether a given date should be marked as unselectable. |
| Prop | Type | Default | Description |
|---|---|---|---|
| default | slot | - | Default slot content rendered inside the component root. |
| Prop | Type | Default | Description |
|---|---|---|---|
| root* | root | - | The date picker container |
| trigger | part | - | The toggle button |
| content | part | - | The calendar popover content |
该组件尚无扩展说明文档。
键盘与焦点
跨 React、Vue 与小程序共享的交互与可读名称约定。
行为契约
props、默认值和运行时状态。