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

    布局@rockshin/tao-ui

    通过可拖动分隔条调整相邻面板尺寸。

    何时使用

    用户需要在多个工作区域之间动态分配空间时使用 Splitter。

    推荐

    • 设置合理的最小尺寸。
    • 可折叠面板必须保留可发现入口。

    避免

    • 移动端或简单阅读页不要滥用分隔面板。

    代码演示

    基础用法

    TSX

    垂直与多面板

    TSX

    可折叠面板

    TSX

    三个面板

    多个 Splitter.Panel 共享可用空间,拖动相邻分隔条调整比例。

    TSX

    折叠面板

    允许辅助面板收起后恢复,保留主要工作区域。

    TSX

    尺寸上下限

    通过 min 与 max 约束拖动范围,避免内容缩小到不可操作。

    TSX

    受控面板尺寸

    监听尺寸变化并保存当前布局,可由应用逻辑重置布局。

    sizes: []

    TSX

    嵌套分栏

    横向与纵向分栏组合出编辑器布局,每个容器都有明确高度。

    TSX

    API

    Panel

    属性说明类型默认值
    style节点样式CSSProperties | undefined-
    className节点类名string | undefined-

    Splitter

    属性说明类型默认值
    className节点类名string | undefined-

    Splitter.Panel

    属性说明类型默认值
    style节点样式CSSProperties | undefined-
    className节点类名string | undefined-