--- url: https://rickyshin93.github.io/tao-ui/zh/guide/getting-started.md --- > 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. # 快速开始 React 和 React DOM 最低需要 18.2,同时兼容 React 19,两者的 peer dependency 范围均为 `^18.2.0 || ^19.0.0`。日期组件使用的 `dayjs` 是普通依赖,会自动安装。使用你偏好的包管理器安装 tao-ui。 ```sh [npm] npm install @rockshin/tao-ui ``` ```sh [yarn] yarn add @rockshin/tao-ui ``` ```sh [pnpm] pnpm add @rockshin/tao-ui ``` ```sh [bun] bun add @rockshin/tao-ui ``` ```sh [deno] deno add npm:@rockshin/tao-ui ``` ## 添加 Provider 在应用根部包裹一次 `TaoProvider`。组件会继承尺寸、禁用状态与主题模式等设置。 ```tsx import { Button, TaoProvider } from '@rockshin/tao-ui'; export default function App() { return ( ); } ``` ## 按组件引入 按组件入口引入时,只加载对应组件及其依赖的样式,并自动包含公共主题样式,无需额外导入 CSS。现有根入口继续可用,会包含全部组件样式。 ```tsx import { Button, type ButtonProps } from '@rockshin/tao-ui/button'; import { TaoProvider } from '@rockshin/tao-ui/provider'; ``` 入口使用短横线命名,例如 `/input-number`、`/range-picker`、`/form-layout`。同组导出共用入口:`CheckboxGroup` 使用 `/checkbox`,`HeadlessInputNumber` 使用 `/number-input`。 ## 控制字段值 Input、Textarea、InputNumber、Select、DatePicker 和 RangePicker 中,显式传入 `value={undefined}` 表示受控空值。非受控字段应省略 `value`,使用 `defaultValue` 设置初始值。表单中可通过 `form.setFieldsValue({ field: undefined })` 清空字段,无需重新挂载控件。 ## 使用深色模式 在 Provider 上设置主题模式。通过 Portal 渲染的组件也会继承同一主题。 ```tsx ``` 继续阅读 [Button 组件](https://rickyshin93.github.io/tao-ui/zh/components/button.md)。 ## 无障碍与 ARIA 使用 `FormField` 或 `Form.Item` 为控件关联标签、说明与错误信息。Input、Textarea、InputNumber、Select、Checkbox、Radio、Switch、DatePicker 和 RangePicker 会将字段 ARIA 属性传递到实际交互元素;CheckboxGroup 与 RadioGroup 支持分组标签及错误关联。占位符不能代替字段标签。 ```tsx ``` Radio 将 `aria-required` 转为原生 `required`,显式 `required` prop 优先。分组选项使用各自的原生禁用状态,保留子项 `disabled={false}` 的覆盖行为。 桌面日期输入框使用 `combobox` 语义,按方向下键打开日历并移入焦点,Escape 关闭并返回输入框。RangePicker 的两个输入框组合显式 ARIA 标签和各自占位符作为名称,请提供可区分的起止文案;原生 `label` 可分别关联 `id` 和 `${id}-end`。日历、月份、年份、时间选项均暴露选中态。 - Tabs 使用 `aria-label` 或 `aria-labelledby` 命名标签组;文本面板可通过 Tab 聚焦。 - Modal、Drawer、Popover 使用可见 `title` 或显式 ARIA 名称;Popconfirm 自动关联问题和说明。 - Spinner 可用 `aria-label` 自定义加载名称;无提示文案时默认为 `Loading`,包裹内容在加载期间(包括延迟显示阶段)标记 `aria-busy`。 - 仅含图标的按钮仍需要应用提供有意义的名称。 自动测试验证 React 18/19 的 DOM 语义和键盘行为,应用仍需对组合后的页面进行浏览器及读屏检查。交互依据参考 [WAI-ARIA 日期组合框示例](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-datepicker/) 和 [Tabs 模式](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/)。 --- url: https://rickyshin93.github.io/tao-ui/zh/guide/agents.md --- > 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. # 与 AI Agent 协作 tao-ui 是 MIT 许可的 React 组件库,支持 React 与 React DOM 18.2、19,提供 Provider 默认配置、语义化 `classNames` / `styles` 和 OKLCH 种子主题。双语文档同时服务开发者和编程 Agent。 ## 按问题选择资料 | 入口 | 用途 | | --------------------------------------------------------------------------------------- | ------------------------------------------------ | | [agent-manifest.json](https://rickyshin93.github.io/tao-ui/agent-manifest.json) | 官网对应包版本、peer 依赖、准确的组件导入路径和中英文 HTML / Markdown 地址 | | [component-manifest.json](https://rickyshin93.github.io/tao-ui/component-manifest.json) | 组件描述、使用建议、语义部件、关联组件和精选属性 | | [llms.txt](https://rickyshin93.github.io/tao-ui/zh/llms.txt) | 精简导航索引,按需读取相关页面 | | [llms-full.txt](https://rickyshin93.github.io/tao-ui/zh/llms-full.txt) | 确实需要批量上下文时读取完整中文文档 | | 安装包的 `.d.ts` 和组件页生成的 API 表 | 准确的属性类型、回调签名和重载 | `agent-manifest.json` 是本项目的发现格式,当前 `schemaVersion: 1`,并非 MCP 服务器或通用 Agent 协议。官网跟随当前发布版本;复制 API 前先核对安装包版本。元数据里的 `props` 是精选列表,可能不完整;完整类型以声明文件为准。 ## 生成组件的流程 1. 读取项目安装的包版本和 peer 依赖要求。 2. 在发现索引中定位组件,读取对应 Markdown 页面里的示例和 API 表。 3. 使用记录的入口。`TaoProvider` 来自 `/provider`;`HeadlessInputNumber` 和 `useNumberInput` 来自 `/number-input`。 4. 用 `TaoProvider` 包裹应用;通过已记录的语义部件与 `classNames` / `styles` 定制样式。 5. 执行消费项目的类型检查,并操作相关交互;响应式控件还需检查窄屏。 ```tsx import { Button } from '@rockshin/tao-ui/button'; import { TaoProvider } from '@rockshin/tao-ui/provider'; export default function App() { return ( ); } ``` 组件入口会加载自己的 CSS 和共享主题,无需额外导入 CSS。包根入口同样可用,会包含所有组件样式。React 是 peer 依赖;日期组件需要的 `dayjs` 会自动安装。 Next.js App Router 的交互代码放在客户端组件中(`'use client'`)。组件用法以 tao-ui 的 API 文档和类型声明为准。例如,表单控件区分不传 `value` 和 `value={undefined}`,具体见[快速开始](https://rickyshin93.github.io/tao-ui/zh/guide/getting-started.md#%E6%8E%A7%E5%88%B6%E5%AD%97%E6%AE%B5%E5%80%BC)。 ## 读取安装包契约 ```ts import { getComponentDoc } from '@rockshin/tao-ui/meta'; const button = getComponentDoc('button'); console.log(button?.semanticParts); ``` Node 工具可直接读取 JSON,无需加载 UI 代码: ```js import { readFileSync } from 'node:fs'; import { createRequire } from 'node:module'; const require = createRequire(import.meta.url); const file = require.resolve('@rockshin/tao-ui/component-manifest.json'); const manifest = JSON.parse(readFileSync(file, 'utf8')); console.log(manifest.components.find((item) => item.name === 'button')); ``` 安装包还包含 `llms.txt`。组件元数据中的源码、Story 和测试路径指向仓库,并不是网站路由,也不代表这些文件包含在 npm 包内。 ## 浏览器工具 Rspress 通过实验性的 WebMCP 提供六个文档工具:`rspress_get_site_info`、`rspress_list_pages`、`rspress_get_page`、`rspress_get_current_page`、`rspress_search_docs` 和 `rspress_navigate`。使用它们需要浏览器在 HTTPS 或 localhost 下支持 `document.modelContext`;不支持的浏览器仍可读取上面的 JSON 和 Markdown。无需 API key 或独立 MCP 服务。 这些工具用于读取和导航文档,不会执行你的应用,也不代表生成代码已通过测试。详情见 [Rspress WebMCP 文档](https://www.rspress.rs/guide/basic/webmcp)。 --- url: https://rickyshin93.github.io/tao-ui/zh/guide/changelog.md --- > 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. # 更新日志 按版本记录 `@rockshin/tao-ui` 的用户可见变更。日期使用 UTC+8。 ## 0.0.57 2026-11-16 - [Form](https://rickyshin93.github.io/tao-ui/zh/components/form.md) 通过 `setFields` 或受控 `fields` 属性写入新值时,清除旧值残留的校验错误;同一条目显式传入 `errors`/`warnings` 时以调用方为准。 - [Modal](https://rickyshin93.github.io/tao-ui/zh/components/modal.md) 每次打开都会聚焦配置的按钮,关闭后把焦点归还触发元素,内容在多次打开间保留时同样生效。 - [Select](https://rickyshin93.github.io/tao-ui/zh/components/select.md) 多选标签中的节点标签保持富文本内容,文本与数字标签仍按 `maxTagTextLength` 截断。 - [Steps](https://rickyshin93.github.io/tao-ui/zh/components/steps.md) 新增 `finishIconBackground` 与 `finishIconColor`,可自定义完成步骤圆形底色与对勾颜色。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.56...v0.0.57) ## 0.0.56 2026-11-13 - [Select](https://rickyshin93.github.io/tao-ui/zh/components/select.md) 修复部分字体下选项文字上下被裁切的问题。 ## 0.0.55 2026-11-13 - [Select](https://rickyshin93.github.io/tao-ui/zh/components/select.md) 支持长选项完整换行,并修复已选标签挤占输入框的问题。 ## 0.0.54 2026-11-10 - [Textarea](https://rickyshin93.github.io/tao-ui/zh/components/textarea.md) 将字符计数与拖拽手柄并排对齐在底角,并为输入文字预留空间。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.53...v0.0.54) ## 0.0.53 2026-11-10 - [Textarea](https://rickyshin93.github.io/tao-ui/zh/components/textarea.md) 将字符计数放在输入框内,不再额外占一行。 - [Upload](https://rickyshin93.github.io/tao-ui/zh/components/upload.md) 图片卡片操作按钮在遮罩上保持透明背景。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.52...v0.0.53) ## 0.0.52 2026-11-10 - [Upload](https://rickyshin93.github.io/tao-ui/zh/components/upload.md) 对齐图片卡片、圆形列表、缩略图及文件操作;卡片上传入口排列在文件列表末尾,并支持通过 `null` 或 `false` 隐藏。上传中的文件显示进度,下载操作仅对已完成文件展示;Dragger 高度单独作用于拖拽区域。 - [Input](https://rickyshin93.github.io/tao-ui/zh/components/input.md) 切换密码可见性时保持占位符字体一致;[Modal](https://rickyshin93.github.io/tao-ui/zh/components/modal.md) 为内容区保留纵向空间,避免裁切控件焦点环。 - Upload 文档扩充中英文示例与 API 说明,加入原创示例图片及响应式双列布局。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.51...v0.0.52) ## 0.0.51 2026-11-08 - Button 统一嵌套 SVG 图标的尺寸并保留显式宽高;Input 后缀内容居中;Select 多选单行保持预期高度;Transfer 选择箭头对齐并明确禁用状态。 - 文档新增中英文 Showcase 和响应式商城示例;全新构建时会先准备 Showcase 所用的图标包。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.49...v0.0.51) ## 0.0.50 2026-11-08 - [Button](https://rickyshin93.github.io/tao-ui/zh/components/button.md) 统一嵌套 SVG 图标的尺寸,同时保留显式指定的宽高。 - [Input](https://rickyshin93.github.io/tao-ui/zh/components/input.md) 的后缀内容居中;[Select](https://rickyshin93.github.io/tao-ui/zh/components/select.md) 多选内容为单行时保持预期高度。 - [Transfer](https://rickyshin93.github.io/tao-ui/zh/components/transfer.md) 的选择菜单箭头与 Select 对齐,并明确禁用状态。 - 文档新增中英文 Showcase 和响应式商城示例,并更新组件页与首页。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.49...v0.0.50) ## 0.0.49 2026-11-07 **数据录入与选择** - [Form](https://rickyshin93.github.io/tao-ui/zh/components/form.md) 在字段重置时同步清空受控输入,完善校验反馈和原生提交行为。 - [Select](https://rickyshin93.github.io/tao-ui/zh/components/select.md) 在应用拒绝受控多选变更时保留搜索词,包含分隔符的选项值可以完整匹配。 - [Upload](https://rickyshin93.github.io/tao-ui/zh/components/upload.md) 会在出错的文件行显示请求初始化错误,同批其他文件继续上传。请求成功或失败后,迟到的回调不会改写结果。禁用上传时也会忽略粘贴的文件。 - [RangePicker](https://rickyshin93.github.io/tao-ui/zh/components/range-picker.md) 清空时丢弃尚未确认的输入。DatePicker 和 RangePicker 的键盘打开请求未被接受时,如果用户已移开焦点,后续打开不会抢回焦点。 - [Cascader](https://rickyshin93.github.io/tao-ui/zh/components/cascader.md) 在移动端点击「完成」时,跳过新增后被移除或禁用的路径,保留此前已经提交的路径。 - [Table](https://rickyshin93.github.io/tao-ui/zh/components/table.md) 全选时根据最新的禁用状态处理当前页可选行。响应式列出现时会保留配置的默认排序。 - [Input](https://rickyshin93.github.io/tao-ui/zh/components/input.md) 和 [Textarea](https://rickyshin93.github.io/tao-ui/zh/components/textarea.md) 在输入法组合被打断后,可以正常响应下一次回车。Textarea 自动高度计入自定义内边距和边框。修改 CheckboxGroup 和 Slider 回调传出的数组不会影响组件状态。 **弹层与展示** - [Image](https://rickyshin93.github.io/tao-ui/zh/components/image.md) 在禁用预览时会移除已打开的弹层。重新启用后需再次打开,应用受控指定为打开时除外。 - [Modal](https://rickyshin93.github.io/tao-ui/zh/components/modal.md) 的 `Modal.destroyAll()` 遇到 `afterClose` 回调抛错时,会先关闭其余弹窗,再抛出异常。Tour 在步骤未配置滚动选项时使用顶层配置,FloatButton 支持在所在 iframe 内检测外部点击。 - [Badge](https://rickyshin93.github.io/tao-ui/zh/components/badge.md) 可以在包裹的内容上显示状态圆点,并按 RTL 方向定位。Card 支持在页签栏传入一组操作项,BorderBeam 更换宿主元素后会重新开始动画。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.48...v0.0.49) ## 0.0.48 2026-11-06 **修复与改进** - **Form** 为单行反馈预留 24px(18px 文本行、上方 2px、下方 4px),适用于 12–14px 的反馈字号。提示保留原字号,单行出现时字段位置稳定,长提示仍可换行。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.47...v0.0.48) ## 0.0.47 2026-11-06 **修复与改进** - **Form** 修复从表单子路径导入时丢失的必填与错误样式,缩小反馈间距,无校验和提示的字段不再留空行。 - **Cascader** 在移动端使用底部抽屉,支持抽屉内搜索,单选即时应用,多选在点击完成后应用。调整了清除入口和展开箭头的对齐。 **文档** - 中英文文档统一配色、导航和并排示例布局。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.46...v0.0.47) ## 0.0.46 2026-11-06 **新增** - **TaoProvider** 新增 17 个语言包,支持从包根或 `@rockshin/tao-ui/locale/*` 按需导入。全局语言覆盖组件标签、空态、弹窗操作和表单校验,也适用于通过 Portal 渲染的内容。 - **DatePicker、RangePicker、Calendar 和 TimePicker** 支持地区化文案和日历习惯。地区化日期和时间格式可解析用户输入,组件级语言设置优先。 - **InputNumber 和 Statistic** 按地区展示数字和分隔符。InputNumber 继续输出保留精度的十进制字符串,日期选择器在显式选择地区化格式时才改变默认输出格式。 **文档** - 中英文站点更新矢量标志、深色版本和网站图标。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.45...v0.0.46) ## 0.0.45 2026-11-06 **新增** - **TaoProvider** 新增 `direction`,组件和 Portal 继承方向,组件可单独覆盖或使用原生 `dir="auto"`。 **修复与改进** - **RTL** 修复横向滚动、Splitter 拖拽、Rate 输入、分页图标、Table 对齐和固定列,以及选择控件的键盘操作。桌面和移动弹层继承触发端方向。 **兼容性** - **Segmented** 修复 React 18 下键盘导航触发最大更新深度错误的问题。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.44...v0.0.45) ## 0.0.44 2026-11-05 **新增** - **Form** 新增 `FormInstance.scrollToField(name, options)`,支持已挂载的嵌套字段、`Form.List` 路径和 `noStyle` 项。可设置滚动行为和聚焦,`FormScrollOptions` 可从包根和表单子路径导入。 **修复与改进** - 修复中文 AI Agent 指南链接重复拼接语言路径的问题。 **迁移** - 需要定位到自定义控件时,控件应转发 DOM 或 `nativeElement` ref,或转发字段 ID。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.43...v0.0.44) ## 0.0.43 2026-11-05 **新增** - **Input** 增加清除和计数,补齐 Password、Search、TextArea、OTP 及下划线样式。 - **Collapse** 支持面板配置、手风琴交互和内置样式。 **修复与改进** - 优化 Calendar 和 Carousel 控件、RadioGroup 选择、Form 反馈间距、Tree 和 TreeSelect 勾选以及响应式选择器标题,修复控件 CSS 隔离和深色主题细节。 **迁移** - 将 `Collapsible` 和 `/collapsible` 导入迁移至 `Collapse` 和 `/collapse`。 **文档** - 改版中英文站点,新增 Agent 指南、`agent-manifest.json`、包内 `component-manifest.json` 导出及可检索的 Markdown 文档。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.42...v0.0.43) ## 0.0.42 2026-11-05 **新增** - 组件目录扩充至 73 个可视条目,新增 Cascader、Tree、TreeSelect、Upload、Transfer、Calendar、ColorPicker、Carousel 和用于应用级反馈的 App 等。 - 新增公开的 `GetProps`、`GetProp` 和 `GetRef` 工具类型,用于从组件推导类型。 **修复与改进** - 改善选择控件的响应式布局、全局本地化与焦点处理,默认主题圆角统一为 6px。 **文档** - 中英文文档补齐可运行示例,支持独立的手机和桌面预览、同步深色模式及代码复制。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.41...v0.0.42) ## 0.0.41 2026-11-04 **修复与改进** - **Select** 修复限制高度的选项列表无法纵向滚动的问题,覆盖普通单选、可搜索、多选和标签模式。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.40...v0.0.41) ## 0.0.40 2026-10-30 **修复与改进** - **表单字段、选择器和弹层** 改进原生标签、必填和禁用语义及焦点还原。RangePicker 为起止输入分别命名并播报已确认的范围,移动端 Select 暴露当前选项和搜索标签。 - **Tabs、Spinner 和 Tag** 完善键盘交互或无障碍状态。Popover 和确认对话框使用可见标题作为无障碍名称。 **兼容性** - tao-ui 迁入 Bun workspace,构建升级至 Rslib 1.x,npm 包名仍为 `@rockshin/tao-ui`。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.39...v0.0.40) ## 0.0.39 2026-10-18 **修复与改进** - **主题、Table、Tag 和 Steps** 使用 OKLab 混合彩色和中性色,使主色与状态背景更接近原色相,并提高表格悬停背景和行分割线的辨识度。 - **Select** 扩大 `allowClear` 的点击区域,点击清除图标边缘时可清空选项,避免误开弹层。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.38...v0.0.39) ## 0.0.38 2026-10-15 **新增** - **Table** 在设置 `scroll.y` 后支持固定表头,新增 `expandable` 展开行和可固定、可对齐固定列的 `Table.Summary` 汇总区。 **修复与改进** - **Table** 保持固定表头和单元格背景不透明,容器缩放时重新计算边缘阴影,加载遮罩覆盖整张表格。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.37...v0.0.38) ## 0.0.37 2026-10-12 **修复与改进** - **Popover** 回到通用弹层层级,内嵌 Select、Menu 或 DatePicker 展开时会显示在父级 Popover 上方。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.36...v0.0.37) ## 0.0.36 2026-10-05 **修复与改进** - **Table** 的排序、筛选和分页回调使用一致的数据视图,并以父组件传入的受控状态为准。 - **Select** 统一变更、选中、取消选中和清除的回调顺序。移动端确认后通知已提交的变化,取消时丢弃草稿。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.35...v0.0.36) ## 0.0.35 2026-09-13 **修复与改进** - **Tabs** 的激活指示线使用直角端点,修复缩放到当前标签宽度时端点变尖的问题。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.34...v0.0.35) ## 0.0.34 2026-09-13 **新增** - 新增 **Steps**,支持编号进度、各步骤独立状态、键盘激活和通过 `maxCount` 折叠长流程。 **修复与改进** - **Table** 的行分割线在有色背景上保持可见,边角单元格背景沿表格圆角绘制。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.33...v0.0.34) ## 0.0.33 2026-09-08 **修复与改进** - **Select** 的标签模式在禁用空态内容时不再弹出空白列表,仍可输入新标签、显示后缀图标、自定义空态和弹层。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.32...v0.0.33) ## 0.0.32 2026-09-06 **修复与改进** - **DatePicker 和 RangePicker** 正确处理日期边界变化、受控编辑被拒绝和表单主动清空,并同步可见月份。 - **Select、Table、InputNumber 和 Splitter** 修复搜索、选中、分页、数字输入和拖拽状态的更新问题。 - **Popover、Modal、Checkbox、Tabs 和 Form** 改善焦点管理、标签关联、选中状态渲染和布尔字段清空。 **兼容性** - 在 React 19 之外新增 React 18.2 支持和 ref 兼容,提供可单独导入组件及其样式的子路径。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.31...v0.0.32) ## 0.0.31 2026-09-01 **修复与改进** - **Table** 固定表头使用当前变体的背景色,固定列在横向仍有可滚动内容时显示边缘阴影。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.30...v0.0.31) ## 0.0.30 2026-08-28 **新增** - **Button** 新增 `bare` 变体,保留交互行为,外观可由调用方定义。 **修复与改进** - **Button** 默认样式移到低优先级的组件层,消费方类名可以覆盖颜色、间距和形状。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.29...v0.0.30) ## 0.0.29 2026-08-27 **修复与改进** - **Input** 居中原生文本行框,修复光标和选区在控件中偏高的问题。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.28...v0.0.29) ## 0.0.28 2026-08-25 **修复与改进** - **Textarea** 将低优先级默认样式放入组件级联层,允许语义化 DOM 类名覆盖内部输入框样式。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.27...v0.0.28) ## 0.0.27 2026-08-19 **修复与改进** - **DatePicker 和 RangePicker** 在受控编辑被拒绝时恢复当前值,关闭或收到新值时取消尚未完成的范围选择。 - **Select** 解析重复值时保留首个选项。**Sonner** 不再被旧退出定时器误删重建的通知,并在 Promise 结束时正确清理加载提示。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.26...v0.0.27) ## 0.0.26 2026-08-19 **新增** - 新增支持字段校验、列表和依赖联动的 **Form**,以及 **Alert**、**Popover**、**Popconfirm** 和 **Tooltip**。 - **Table** 列支持响应式断点,新增公开的响应式辅助函数和主题 Token 工具。 **修复与改进** - **Button** 在 Flex 居中时保留文本行框,改善不同应用字体下的垂直对齐。 **文档** - 新增中英文 Rspress 文档,提供可运行示例和 API 表格。[文档 PR](https://github.com/rickyshin93/tao-ui/pull/2) [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.25...v0.0.26) ## 0.0.25 2026-08-04 **修复与改进** - **Input** 分别校准文本和密码圆点的位置,调整掩码字形时保留密码选区的行框位置。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.24...v0.0.25) ## 0.0.24 2026-08-04 **修复与改进** - **Input** 按控件尺寸设置垂直内边距,使原生文本和密码掩码字形居中。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.23...v0.0.24) ## 0.0.23 2026-08-04 **修复与改进** - **Input** 将浏览器自动填充背景限制在圆角边界内,并保留正常的文本垂直度量。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.22...v0.0.23) ## 0.0.22 2026-08-03 **新增** - 为可视组件提供带类型的语义化 DOM 契约,并提供独立的元数据和主题工具导入入口。 **修复与改进** - **DatePicker** 改善键盘导航,**FormField** 为控件关联标签和帮助文本,**Select** 将选中勾标保留在弹层宽度内。 - **Button** 调整图标尺寸与文本间距。**TaoProvider** 响应禁用动效的配置,并在 `inherit={false}` 时重置继承的主题种子。 **迁移** - 原先从包根导入元数据和主题工具的代码可迁移至 `@rockshin/tao-ui/meta` 和 `@rockshin/tao-ui/tokens`。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.21...v0.0.22) ## 0.0.21 2026-07-26 **新增** - **Input** 支持 React SVG 前缀,自动定位图标并为输入文字预留空间。 **修复与改进** - **Drawer 和 Modal** 在允许点击遮罩关闭时,仅响应实际的遮罩点击。操作内部 Portal 时对话框保持打开。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.20...v0.0.21) ## 0.0.20 2026-07-25 **修复与改进** - **Input** 有前缀时去掉重复的起始内边距,让文字和前缀之间保持预期距离。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.19...v0.0.20) ## 0.0.19 2026-07-25 **兼容性** - 更新 Rslib、Rstest 和 Storybook 开发工具,发版时同步 Bun 锁文件。此补丁未改动组件。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.18...v0.0.19) ## 0.0.18 2026-07-25 **新增** - **TaoProvider** 通过 `theme.mode` 支持深色模式,嵌套 Provider 继承模式,Portal 组件带上触发端主题。[PR #1](https://github.com/rickyshin93/tao-ui/pull/1) - **DatePicker 和 RangePicker** 桌面端支持按格式手输,移动端保留抽屉。可搜索 **Select** 支持桌面单选直接输入,以及多选和标签模式内联搜索。 **修复与改进** - **Input 和 RangePicker** 改善前缀及文本对齐,Table、Tag、Modal 和 Drawer 的表面与遮罩颜色改为使用主题 Token。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.17...v0.0.18) ## 0.0.17 2026-07-12 **新增** - **Button** 新增 `icon` 和 `loadingIcon`,切换加载状态时保留图标插槽,减少布局闪动。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.16...v0.0.17) ## 0.0.16 2026-07-12 **修复与改进** - **Sonner** 根据通知实际高度计算展开后的堆叠位置,移除时保持位置稳定,并改善进出动画和关闭按钮的点击区域。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.15...v0.0.16) ## 0.0.15 2026-07-12 **新增** - 新增 **Sonner** 和命令式 `toast()` API,支持状态色、自定义内容、操作按钮,以及 Promise 驱动的加载、成功和错误状态。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.14...v0.0.15) ## 0.0.14 2026-07-10 **新增** - **Select** 新增搜索、多选和标签模式、自定义标签渲染及选择数量限制,移动端多选通过抽屉确认。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.13...v0.0.14) ## 0.0.13 2026-07-09 **修复与改进** - **Checkbox 和 Radio** 将原生输入限制在可视控件范围内,保留聚焦和点击能力,避免拦截控件外的点击。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.12...v0.0.13) ## 0.0.12 2026-07-05 **修复与改进** - **Select、DatePicker、RangePicker、Dropdown 和菜单** 将 Portal 主题 Token 直接应用到弹层元素,避免关闭时遗留空包装节点。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.11...v0.0.12) ## 0.0.11 2026-07-05 **新增** - 新增组件元数据清单,并公开组件属性和语义化 DOM 类型。 **修复与改进** - **Breadcrumb** 将操作项渲染为按钮。**DatePicker** 的日期单元使用可聚焦的原生按钮,提供无障碍名称和禁用状态。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.10...v0.0.11) ## 0.0.10 2026-07-05 **修复与改进** - **FormSection** 消除原生 fieldset 和 legend 带来的额外留白,Portal 主题作用域不再占用 Flex 和 Grid 布局空间。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.9...v0.0.10) ## 0.0.9 2026-07-04 **新增** - 新增主题化数字输入 **InputNumber**,支持数字分组、光标位置保持及保留精度的标准字符串值,同时提供无样式的数字输入能力。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.8...v0.0.9) ## 0.0.8 2026-07-03 **新增** - **Table** 新增 `onRow`、`onHeaderRow`、`onCell` 和 `onHeaderCell`,支持行样式以及回调形式的语义化 DOM 定制。 **修复与改进** - **Tag** 调整间距和行高,使文字与图标对齐更一致。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.7...v0.0.8) ## 0.0.7 2026-07-03 **新增** - **Table** 默认使用新的 `modern` 变体,采用低对比度边框和更轻的表头,仍可显式指定已有变体。 **修复与改进** - **Select** 调整文字和图标的对齐,支持 Enter 或空格清除。**Tag** 改善语义色背景和关闭按钮样式。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.6...v0.0.7) ## 0.0.6 2026-07-02 **修复与改进** - **TaoProvider** 在嵌套作用域重新计算派生 Token,并让子元素保持在父级 Flex 或 Grid 布局中。相同的内联 Token 值不会触发多余的上下文更新。 - **主题和 Button** 将默认圆角从 6px 调整至 10px,优化焦点环、边框、按钮字重和阴影。 **迁移** - **Input、Textarea、Select 和日期选择器** 默认占满可用宽度。依赖原先 200px 默认宽度的布局需显式指定宽度。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.5...v0.0.6) ## 0.0.5 2026-07-01 **修复与改进** - **Input** 在 Flex 行内占满可用宽度,单行 **Textarea** 与同尺寸 Input 等高。 **兼容性** - 修复严格 tree shaking 时包入口样式可能被移除的问题。 **迁移** - 需要保留原先较高的 Textarea 默认高度时,显式设置 `rows={3}`。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.4...v0.0.5) ## 0.0.4 2026-06-08 **兼容性** - 使用原生 CSS 替换 Tailwind 和 PostCSS 生成的样式,在包入口统一导入主题及控件样式。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.3...v0.0.4) ## 0.0.3 2026-06-07 **新增** - **Select** 增加 Ant Design 风格的单选 API,支持受控开关、弹层方向和宽度、自定义渲染、分组选项及语义化样式。 - 新增 **Spinner**,支持延迟显示、自定义指示器、内容遮罩和全屏模式。 **修复与改进** - Portal 中的控件继承主题 Token,弹层显示在 Modal 和 Drawer 上方,清空 Select 时保持弹层关闭。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.2...v0.0.3) ## 0.0.2 2026-06-07 **新增** - 新增 **Breadcrumb、Collapsible、ContextMenu、Dropdown 和 Textarea**。Textarea 支持通用控件变体以及可指定最少和最多行数的 `autoSize`。 - 新增 **Modal**,支持受控 `open`、命令式确认和状态弹窗方法,以及 `Modal.useModal()`。 **修复与改进** - 表单控件共用焦点和变体样式,容器与浮层表面使用白色和派生中性色。 [查看版本差异](https://github.com/rickyshin93/tao-ui/compare/v0.0.1...v0.0.2) ## 0.0.1 2026-06-06 **新增** - **@rockshin/tao-ui** 首次发布,支持 React 19、语义化 DOM 定制和 OKLCH 主题 Token。 --- url: https://rickyshin93.github.io/tao-ui/zh/components/border-beam.md --- > 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. # BorderBeam 通用`@rockshin/tao-ui` [代码演示](#代码演示)[API](#api) 用沿边框移动的光束突出活动中的区域。 组件采用 tao-ui 原生实现,公共 API 对齐 Ant Design 6.7.0。外观、主题 token 与 Semantic DOM 定制遵循 tao-ui,主题通过 `TaoProvider` 配置。 属性遵循 6.7.0 光束 API,子元素需暴露原生 DOM ref 或 nativeElement 句柄;动画只改变 transform,并遵循减弱动态效果偏好。 ## 何时使用 用于需要强调的活动或处理中状态,同时保留明确的文字状态。 ## 代码演示 ### 活动卡片 ```tsx preview import { BorderBeam, Card } from "@rockshin/tao-ui"; export default function Example() { return ( 12 tasks are running. ); } ``` ### 数量与时长 ```tsx preview import { BorderBeam, Card } from "@rockshin/tao-ui"; export default function Example() { return ( Two highlights follow the same border with evenly spaced phases. ); } ``` ### 自定义渐变与单束覆盖 ```tsx preview import { BorderBeam, Card } from "@rockshin/tao-ui"; export default function Example() { return ( Each item controls its own color, size and line width. ); } ``` ### 偏移与不同圆角 ```tsx preview import { BorderBeam, Card } from "@rockshin/tao-ui"; export default function Example() { return ( The effect follows the top rounded corners and the square bottom corners. ); } ``` ### 切换活动状态 ```tsx preview import { useState } from "react"; import { BorderBeam, Button, Card } from "@rockshin/tao-ui"; export default function Example() { const [active, setActive] = useState(true); return (
The border animation follows the current state.
); } ``` ## API ### [#](#borderbeam)BorderBeam | 属性 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | className | 节点类名 | `string | undefined` | `-` | | style | 节点样式 | `CSSProperties | undefined` | `-` | --- url: https://rickyshin93.github.io/tao-ui/zh/components/button.md --- > 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. # Button 按钮 通用`@rockshin/tao-ui` [代码演示](#代码演示)[API](#api) 触发提交、保存、打开界面等即时操作。 ## 代码演示 ### 变体 每个视图或决策区域只保留一个主操作。Secondary、ghost 与 destructive 变体用于降低或明确操作层级。Bare 保留按钮行为,同时把视觉样式交给消费方的 class 或 style。 ```tsx preview import { Button } from '@rockshin/tao-ui'; function ButtonVariants() { return (
); } export default ButtonVariants; ``` ### 尺寸 密集工具栏使用 `small`,常规操作使用 `medium`,需要突出时使用 `large`。 ```tsx preview import { Button } from '@rockshin/tao-ui'; function ButtonSizes() { return (
); } export default ButtonSizes; ``` ### 加载与禁用 加载按钮会设置 `aria-busy` 并阻止重复操作。图标插槽始终挂载,因此状态切换不会造成内容位移。 ```tsx preview import { useState } from 'react'; import { Button } from '@rockshin/tao-ui'; function ButtonStates() { const [saving, setSaving] = useState(false); function save() { setSaving(true); window.setTimeout(() => setSaving(false), 1200); } return (
); } export default ButtonStates; ``` ### 图标与自定义加载 通过 `icon` 传入装饰性前置图标。SVG 的显式宽高会被保留;未指定的宽高默认为按钮字号。只有内置 spinner 不符合周围视觉语言时才使用 `loadingIcon`。 ```tsx preview import { Button } from '@rockshin/tao-ui'; function DownloadIcon() { return ( ); } function ProgressIcon() { return ( ); } function ButtonIcons() { return (
); } export default ButtonIcons; ``` ### Provider 默认值 Button 会从 `TaoProvider` 继承 `size` 与 `disabled`,局部属性可以覆盖继承的尺寸。 ```tsx preview import { Button, TaoProvider } from '@rockshin/tao-ui'; function ButtonProviderDefaults() { return (
); } export default ButtonProviderDefaults; ``` ### 语义化定制 通过稳定的 `root` 部件定制样式,无需依赖私有选择器。 ```tsx preview import { Button } from '@rockshin/tao-ui'; function CustomizedButton() { return ( ); } export default CustomizedButton; ``` ### 原生表单按钮 提交与重置遵循原生表单语义,演示不发送网络请求。 ```tsx preview import { useState } from 'react'; import { Button, Input, Stack } from '@rockshin/tao-ui'; export default function Example() { const [result, setResult] = useState(''); return (
{ e.preventDefault(); setResult(String(new FormData(e.currentTarget).get('name'))); }} onReset={() => setResult('')} > {result ? `Saved: ${result}` : 'Edit and save'}
); } ``` ### 纯图标按钮 使用 aria-label 提供名称;图标自身从辅助技术中隐藏。 ```tsx preview import { useState } from 'react'; import { Button } from '@rockshin/tao-ui'; export default function Example() { const [count, setCount] = useState(0); return (
{count} items
); } ``` ### 局部配置与覆盖 局部配置统一尺寸和禁用状态,单个按钮可以明确覆盖。 ```tsx preview import { Button, Stack, TaoProvider } from '@rockshin/tao-ui'; export default function Example() { return ( ); } ``` ## API ### [#](#button)Button | 属性 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | disabled | Prevents interaction. Inherits from TaoProvider. | `boolean | undefined` | `-` | | children | Button label or inline content. | `ReactNode` | `-` | | variant | Visual emphasis for the action. | `"primary" | "secondary" | "ghost" | "destructive" | "bare" | undefined` | `primary` | | size | Control height and horizontal spacing. Inherits from TaoProvider. | `TaoSize | undefined` | `-` | | loading | Shows the loading icon, sets aria-busy, and prevents interaction. | `boolean | undefined` | `-` | | icon | Left-leading decorative icon (non-loading state). | `ReactNode` | `-` | | loadingIcon | Icon shown while loading. Defaults to a built-in spinner. | `ReactNode` | `-` | | classNames | Semantic class overrides keyed by ButtonSemanticPart. | `Partial> | undefined` | `-` | | styles | Semantic style overrides keyed by ButtonSemanticPart. | `Partial> | undefined` | `-` | --- url: https://rickyshin93.github.io/tao-ui/zh/components/icons.md --- > 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. # 图标 浏览适用于通用界面和保险业务的圆角线性图标。按分类浏览,或搜索名称和关键词。点击图标即可复制导入语句。 ## 安装 图标适用于 React 18.2 及以上版本,采用 [MIT 许可 ](/tao-ui/tao-icons-LICENSE.txt)。 ```sh npm install @rockshin/tao-icons ``` ## 图标列表 2060 / 2060 个图标 ### 导航与方向 147 个 arrow-big-downarrow-big-down-dasharrow-big-leftarrow-big-left-dasharrow-big-rightarrow-big-right-dash ### 常用操作 23 个 closecopydownloadfilterfunnellink ### 文件与文档 105 个 archivearchive-restorearchive-xbook-openbookmarkbookmark-minus ### 编辑与绘制 88 个 axis-3dblendbrushcomponentcropdecimals-arrow-left ### 布局与排版 263 个 a-arrow-downa-arrow-upa-large-smallalign-bottomalign-centeralign-center-vertical ### 用户与安全 114 个 awardbadgebadge-alertbadge-checkbadge-infobell-check ### 消息与沟通 119 个 at-signbadge-minusbadge-percentbadge-plusbadge-xballoon ### 音频与影像 100 个 adairplayapertureaudio-linesaudio-lines-offaudio-lines-x ### 时间与状态 77 个 alarm-clockalarm-clock-offalert-circlealert-trianglebell-minusbell-plus ### 设备 76 个 alarm-clock-checkalarm-clock-minusalarm-clock-plusantennabattery-mediumbattery-plus ### 开发工具 92 个 bitcoinblocksbook-copybook-dashedbook-downbook-key ### 购物与地点 99 个 anvilbadge-centbadge-dollar-signbadge-eurobadge-indian-rupeebadge-japanese-yen ### 收藏与常用工具 22 个 axeboltbroombroom-sparkleschart-columnchart-line ### 险种与保障对象 12 个 insurance-accidentinsurance-autoinsurance-commercialinsurance-cyberinsurance-engineeringinsurance-health ### 产品与定价 11 个 coveragecoverage-exclusioncoverage-limitinsurance-deductiblepolicy-wordingpremium-rating ### 渠道与销售 10 个 broker-networkcommission-paymentcommission-planembedded-insuranceinsurance-agentinsurance-needs ### 报价与投保 10 个 applicantapplication-submitbeneficiarybenefit-illustrationelectronic-signatureinsurance-application ### 核保 10 个 medical-underwritingrisk-accumulationrisk-scorerisk-surveyunderwriting-acceptunderwriting-conditions ### 保单全生命周期 13 个 coverage-periodinsurance-certificateinsurance-policypolicy-bindpolicy-cancelpolicy-endorsement ### 账单与收付 44 个 agency-billingarmenian-dramautomatic-paymentbangladeshi-takabanknote-arrow-downbanknote-arrow-up ### 理赔 16 个 claim-appealclaim-assignmentclaim-caseclaim-coverage-checkclaim-denialclaim-investigation ### 再保险与共保 8 个 coinsurance-sharereinsurance-assumedreinsurance-bordereaureinsurance-cessionreinsurance-facultativereinsurance-recovery ### 健康险与团险 12 个 benefit-accumulatorbenefit-planbenefit-statementcost-sharinggroup-policymedical-claim-pricing ### 寿险与年金 9 个 annuity-paymentfund-switchmaturity-benefitpartial-withdrawalpolicy-cash-valuepolicy-loan ### 合规与运营 8 个 complaint-casecustomer-verificationinsurance-ledgerregulatory-reportsanctions-screeningservice-network ### 操作与表单控件 24 个 check-checkcheckboxcheckbox-checkedcheckbox-indeterminatecircle-minuscircle-plus ### 数据与图表 38 个 activitycalculatorchart-areachart-barchart-bar-bigchart-bar-decreasing ### 网络与连接 60 个 batterybattery-chargingbattery-fullbattery-lowbattery-warningbluetooth-connected ### 无障碍 18 个 accessibilitybabybadge-question-markcaptionsclosed-captioncontrast ### 开发与人工智能 19 个 botbracketsbrainchart-networkcloud-checkcloud-off ### 动物与自然 37 个 birdbirdhousebonecannabiscannabis-offcat ### 食物与饮品 76 个 amphoraappleavocadobaconbananabarrel ### 游戏与运动 49 个 backpackbow-arrowchess-bishopchess-kingchess-knightchess-pawn ### 健康与医疗 34 个 ambulancebandagebone-fracturebrain-offbriefcase-medicalcross ### 家居与生活 39 个 air-ventalarm-smokearmchairbedbed-doublebed-single ### 数学与科学 48 个 angleatombeakerbiohazardbrain-circuitbrain-cog ### 形状与符号 33 个 astroidboxboxescircle-dashed-checkcircle-offcircle-pile ### 交通与旅行 63 个 anchorbaggage-claimbathbikebridgebriefcase ### 天气与季节 34 个 bubblescloud-drizzlecloud-fogcloud-hailcloud-lightningcloud-moon ## React 示例 ### 基础用法 从包入口具名导入图标。图标默认以 24px 渲染。 ```tsx preview import { HomeIcon, SearchIcon, SettingsIcon } from '@rockshin/tao-icons'; export default function BasicIcons() { return (
); } ``` ### 尺寸与线宽 用 size 调整尺寸,或用 strokeWidth 改变线宽。 ```tsx preview import { StarIcon } from '@rockshin/tao-icons'; export default function IconSizing() { return (
); } ``` ### 颜色 图标默认继承文字颜色,也可以用 color 单独指定。 ```tsx preview import { HeartIcon, CircleCheckIcon, TriangleAlertIcon } from '@rockshin/tao-icons'; export default function IconColors() { return (
); } ``` ### 按钮与无障碍 文字按钮中的图标可以保持装饰性。仅图标按钮由按钮提供可访问名称。 ```tsx preview import { DownloadIcon, SettingsIcon } from '@rockshin/tao-icons'; import { Button } from '@rockshin/tao-ui'; export default function IconButtons() { return (
); } ``` ### 随状态切换 用 React 状态切换图标。示例中的按钮可直接操作。 ```tsx preview import { useState } from 'react'; import { VolumeIcon, VolumeOffIcon } from '@rockshin/tao-icons'; import { Button } from '@rockshin/tao-ui'; export default function VolumeToggle() { const [muted, setMuted] = useState(false); return ( ); } ``` ### 按图标导入 每个图标都有独立的导入路径。独立表达含义的图标可通过 title 提供名称。 ```tsx preview import { ArrowRightIcon } from '@rockshin/tao-icons/icons/arrow-right'; export default function DirectImport() { return ; } ``` --- url: https://rickyshin93.github.io/tao-ui/zh/components/float-button.md --- > 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. # FloatButton 通用`@rockshin/tao-ui` [代码演示](#代码演示)[API](#api) 提供持续可见的悬浮操作与返回顶部控件。 组件采用 tao-ui 原生实现,公共 API 对齐 Ant Design 6.7.0。外观、主题 token 与 Semantic DOM 定制遵循 tao-ui,主题通过 `TaoProvider` 配置。 按钮、Group 与 BackTop 遵循 6.7.0;提示与徽标使用 tao-ui 组件,滚动动画遵循减弱动态效果偏好;固定控件在 iframe 中预览。 ## 何时使用 适合跨当前页面使用的少量操作,纯图标按钮需提供可访问名称。 ## 代码演示 ### 基础操作与提示 ```tsx preview="iframe-follow" import { useState } from "react"; import { FloatButton } from "@rockshin/tao-ui"; export default function Example() { const [count, setCount] = useState(0); return (

Action count: {count}

setCount(count + 1)} />
); } ``` ### 形状、文字与徽标 ```tsx preview="iframe-follow" import { FloatButton } from "@rockshin/tao-ui"; export default function Example() { return (
); } ``` ### 点击展开分组与位置 ```tsx preview="iframe-follow" import { useState } from "react"; import { FloatButton } from "@rockshin/tao-ui"; export default function Example() { const [selected, setSelected] = useState("None"); return (

Selected: {selected}

setSelected("Action A")} /> setSelected("Action B")} />
); } ``` ### 受控分组 ```tsx preview="iframe-follow" import { useState } from "react"; import { Button, FloatButton } from "@rockshin/tao-ui"; export default function Example() { const [open, setOpen] = useState(false); return (
); } ``` ### 悬停展开与禁用操作 ```tsx preview="iframe-follow" import { FloatButton } from "@rockshin/tao-ui"; export default function Example() { return (
); } ``` ### 返回滚动容器顶部 ```tsx preview="iframe-follow" import { useRef } from "react"; import { FloatButton } from "@rockshin/tao-ui"; export default function Example() { const target = useRef(null); return (

Scroll down to reveal BackTop.

target.current!} visibilityHeight={120} showProgress duration={250} />
); } ``` ## API ### [#](#floatbutton)FloatButton | 属性 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | className | 节点类名 | `string | undefined` | `-` | | style | 节点样式 | `CSSProperties | undefined` | `-` | | disabled | 是否禁用 | `boolean | undefined` | `-` | --- url: https://rickyshin93.github.io/tao-ui/zh/components/watermark.md --- > 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. # Watermark 通用`@rockshin/tao-ui` [代码演示](#代码演示)[API](#api) 在内容与继承的弹层上重复绘制文字或图片水印。 组件采用 tao-ui 原生实现,公共 API 对齐 Ant Design 6.7.0。外观、主题 token 与 Semantic DOM 定制遵循 tao-ui,主题通过 `TaoProvider` 配置。 Canvas 绘制遵循 6.7.0 content/font/gap/offset API;Modal 与 Drawer 默认继承,inherit=false 关闭门户继承;被移除或篡改的覆盖层会恢复。 ## 何时使用 用于标记所有者、工作区或资料类别,同时保持正文可读。 ## 代码演示 ### 文字水印 ```tsx preview import { Watermark } from "@rockshin/tao-ui"; export default function Example() { return (

Workspace report

Content remains selectable and interactive.

); } ``` ### 多行文字与字体 ```tsx preview import { Watermark } from "@rockshin/tao-ui"; export default function Example() { return (
); } ``` ### 旋转、间距与偏移 ```tsx preview import { Watermark } from "@rockshin/tao-ui"; export default function Example() { return (
); } ``` ### 图片与文字后备 ```tsx preview import { Watermark } from "@rockshin/tao-ui"; const image = `data:image/svg+xml,${encodeURIComponent('TAO')}`; export default function Example() { return (
); } ``` ### 继承到 Modal 与 Drawer ```tsx preview="iframe-follow" import { useState } from "react"; import { Button, Drawer, Modal, Watermark } from "@rockshin/tao-ui"; export default function Example() { const [panel, setPanel] = useState(""); return (
{" "} setPanel("")} title="Marked modal" footer={null} >
This portaled panel inherits the watermark.
setPanel("")} title="Marked drawer" >

The drawer inherits the same watermark.

); } ``` ### 关闭门户继承 ```tsx preview="iframe-follow" import { useState } from "react"; import { Button, Modal, Watermark } from "@rockshin/tao-ui"; export default function Example() { const [open, setOpen] = useState(false); return (
setOpen(false)} title="No inherited mark" footer={null} > Only the containing page has a watermark.
); } ``` ## API ### [#](#watermark)Watermark | 属性 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | --- url: https://rickyshin93.github.io/tao-ui/zh/components/divider.md --- > 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. # Divider 布局`@rockshin/tao-ui` [代码演示](#代码演示)[API](#api) 将内容分为清晰的区块或行内分组。 组件采用 tao-ui 原生实现,公共 API 对齐 Ant Design 6.7.0。外观、主题 token 与 Semantic DOM 定制遵循 tao-ui,主题通过 `TaoProvider` 配置。 使用 titlePlacement 控制标题位置,orientation 控制方向;默认尺寸继承 TaoProvider。 ## 何时使用 用于区分相邻内容中的不同区块。 ## 代码演示 ### 区块与标题 ```tsx preview import { Divider } from "@rockshin/tao-ui"; export default function Example() { return (

Workspace overview

Activity

Recent changes and updates.

End of report.

); } ``` ### 标题位置 ```tsx preview import { Divider } from "@rockshin/tao-ui"; export default function Example() { return (
Start Center End Plain label
); } ``` ### 线条与间距 ```tsx preview import { Divider } from "@rockshin/tao-ui"; export default function Example() { return (
Small Dashed Dotted
); } ``` ### 行内分隔与 RTL ```tsx preview import { Divider } from "@rockshin/tao-ui"; export default function Example() { return (
Overview Activity Settings
); } ``` ### 语义样式 ```tsx preview import { Divider } from "@rockshin/tao-ui"; export default function Example() { return ( Custom section ); } ``` ## API ### [#](#divider)Divider | 属性 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | type | @deprecated Use orientation. | `"vertical" | "horizontal" | undefined` | `-` | | orientationMargin | @deprecated Use styles.content margins. | `string | number | undefined` | `-` | --- url: https://rickyshin93.github.io/tao-ui/zh/components/form-layout.md --- > 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. # FormLayout 布局`@rockshin/tao-ui` [代码演示](#代码演示)[API](#api) 为产品级表单提供一致的宽度、区段与操作布局。 ## 何时使用 页面需要由多个字段区段与操作区组成完整表单时使用 FormLayout。 **推荐** - 使用 FormSection 分组相关字段。 - 使用 FormActions 保持操作位置一致。 **避免** - 不要用 FormLayout 包裹与表单无关的页面内容。 ## 代码演示 ### 基础用法 ```tsx preview import { Button, FormActions, FormField, FormLayout, FormSection, Input, } from '@rockshin/tao-ui'; function FormLayoutExample() { return ( ); } export default FormLayoutExample; ``` ### 多个区段 ```tsx preview import { Button, FormActions, FormField, FormLayout, FormSection, Input, } from '@rockshin/tao-ui'; function CompleteFormLayout() { return ( ); } export default CompleteFormLayout; ``` ### 语义化定制 ```tsx preview import { Button, FormActions, FormLayout } from '@rockshin/tao-ui'; function CustomizedFormLayout() { return (

Layout width is customized through the stable root part.

); } export default CustomizedFormLayout; ``` ### 完整表单组合 组合布局、字段与操作区,用原生提交展示保存结果。 ```tsx preview import { useState } from 'react'; import { FormLayout, FormSection, FormField, FormActions, Input, Textarea, Button, } from '@rockshin/tao-ui'; export default function Example() { const [saved, setSaved] = useState(''); return (
{ e.preventDefault(); setSaved(String(new FormData(e.currentTarget).get('name'))); }} onReset={() => setSaved('')} >