Tree · Interactive State · 01
Loading preview...
Component
安装 Installation
用法 Usage
className 与 variant、size 可以一起用。字段以 timkit agent inspect tree --json 的 props 为准。
示例
一次看一个示例。左侧按名称筛选,预览里可切换源码和框架。
13 / 13
结构化 API
与 UCS schema 对齐的 props、逻辑机与多框架运行时。
Component
tree
Logic
none
Runtime Frameworks
Supported Platforms
| Prop | Type | Default | Description |
|---|---|---|---|
| logic.provider* | enum (zag | native | none) | none | State and interaction provider used by this component. |
| logic.machine | string | - | 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 | @headless-tree/core, @timui/core | Runtime package dependencies required by this registry item. |
| optionalPeerDependencies | array | lucide-react | Optional peer dependencies used by this registry item. |
| registryDependencies | array | - | Dependent Timkit registry components/hook entries. |
| Prop | Type | Default | Description |
|---|---|---|---|
| data | array | - | The structured array of data used to render the component. |
| indent | number | 20 | The indentation for children. |
| tree | object | - | The node tree or hierarchical data structure. |
| disabled | boolean | false | When true, expanding and selecting are ignored. |
| selected | string | - | The controlled id of the selected node. |
| Prop | Type | Default | Description |
|---|---|---|---|
| onSelectedChange | event | - | Event handler called with the next selected id. A controlled selected value stays until the parent applies it. |
| Prop | Type | Default | Description |
|---|---|---|---|
| default | slot | - | The tree items |
| Prop | Type | Default | Description |
|---|---|---|---|
| root* | root | - | The tree container |
| item | part | - | A tree node |
| label | part | - | A node label |
| dragLine | part | - | The drag indicator |
该组件尚无扩展说明文档。
键盘与焦点
跨 React、Vue 与小程序共享的交互与可读名称约定。
行为契约
props、默认值和运行时状态。