Elements

组件

标签页 Tabs

Tabs:页签导航。部件:Root、List、Trigger、Content、Indicator(由状态机定位在列表线上的墨色指示条)。

#基础用法

tabs/basic Vue React
Content is ink — the marks that carry the words.
tabs/card Vue React
The brush answers the hand.

#属性

#Root

属性类型默认值描述
sizeString as PropType<"sm" | "md" | "lg">"md"标签行的高度档位
variantString as PropType<"line" | "card">"line"标签页样式:刻线式,或将选中项呈现为卡片
orientationString as PropType<"horizontal" | "vertical">"horizontal"tabs 的方向,可为 horizontal 或 vertical:horizontal 仅支持左右方向键,vertical 仅支持上下方向键
activationMode'manual' | 'automatic'"automatic"tabs 的激活模式,可为 manual 或 automatic:manual 在点击或按 enter 时激活,automatic 在获得焦点时激活
compositeboolean是否为复合组件
defaultValuestringtabs 渲染时的初始选中值;不需要控制选中值时使用
deselectableboolean点击当前激活标签时是否取消选中
idstring组件内部状态机的唯一标识
idsPartial<{ root: string; trigger: (id: string) => string; content: (id: string) => string; list: string; indicator: string; }>tabs 各元素的 id,适合组合使用
loopFocusbooleantrue键盘导航是否从最后一个标签循环到第一个,反向同理
modelValuestringtabs 的 v-model 值
navigate(details: tabs.NavigateDetails) => void点击标签时导航到所选标签的函数;标签触发器是锚点元素时有用
translationstabs.IntlTranslations无障碍元素及其状态的本地化文案