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/slider.md.
v0.0.57
  • 简体中文
  • Slider

    数据录入@rockshin/tao-ui

    使用指针或键盘选择数值或范围。

    何时使用

    适合需要快速调整范围的数值。在滑块附近展示当前值和单位。

    示例

    受控值与完成事件

    onChange 随移动更新;onChangeComplete 在指针或键盘交互完成时报告最终值。

    390 × 640
    TSX

    范围与整体拖动

    拖动手柄调整区间,也可拖动选中轨道整体移动两个端点。

    Budget: 20–60
    TSX

    刻度与离散值

    step= 将选择范围限定到 marks;dots 显示所有步长位置。

    OffLowMidHigh
    0100
    TSX

    提示格式

    formatter= 隐藏提示;open 可保持提示显示。

    TSX

    垂直、反向与 RTL

    垂直滑块需要明确容器高度;direction 控制键盘和水平方向。

    0100
    TSX

    可编辑的多段范围

    点击轨道添加手柄;将手柄拖离轨道可删除,数量受 minCount 和 maxCount 约束。

    Stops: 20, 50, 80
    TSX

    禁用与焦点

    ref 提供 focus 和 blur;语义样式可定制轨道和手柄。

    TSX

    API

    Slider

    属性说明类型默认值