For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/zh/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/zh/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/zh/components/time-picker.md.
v0.0.57
  • 简体中文
  • TimePicker

    数据录入@rockshin/tao-ui

    选择时间或时间范围,支持步长、不可选时段、格式和确认流程。

    新增 API 对齐 Ant Design 6.7.0,外观、主题与 Semantic DOM 使用 tao-ui。既有组件 API 保持原样。

    代码演示

    受控时间与清除

    值使用 Dayjs,清除时返回 null。

    09:30:00

    TSX

    时分与 12 小时制

    format 决定显示的时间列;use12Hours 显示上午和下午。

    TSX

    时间步长

    按 2 小时、15 分钟和 10 秒划分选项。

    TSX

    工作时间限制

    限制上午 9 点至下午 6 点,并隐藏禁用的选项。

    TSX

    三种尺寸

    新增兼容组件的尺寸为 small、middle、large;省略时继承 TaoProvider。

    TSX

    外观与状态

    外观、错误状态和禁用状态可以组合使用。

    TSX

    时间范围

    RangePicker 同时提交开始与结束时间。

    ~

    Choose a range

    TSX

    确认与立即选择

    needConfirm 控制是否先选择再确认。

    TSX

    手机视口与中文

    示例在独立 iframe 中运行;切换手机与桌面观察弹层布局。

    390 × 640
    TSX

    API

    TimePicker.RangePicker

    属性说明类型默认值
    bordered@deprecated Use variant.boolean | undefined-
    popupClassName@deprecated Use classNames.popup.root.string | undefined-
    dropdownClassName@deprecated Use classNames.popup.root.string | undefined-
    popupStyle@deprecated Use styles.popup.root.CSSProperties | undefined-

    TimePicker

    属性说明类型默认值
    onSelect@deprecated Use onCalendarChange.((time: Dayjs) => void) | undefined-
    addon@deprecated Use renderExtraFooter.(() => ReactNode) | undefined-
    bordered@deprecated Use variant.boolean | undefined-
    popupClassName@deprecated Use classNames.popup.root.string | undefined-
    dropdownClassName@deprecated Use classNames.popup.root.string | undefined-
    popupStyle@deprecated Use styles.popup.root.CSSProperties | undefined-