Tabs
导航
@rockshin/tao-ui在同一上下文中切换多个同级内容面板。
何时使用
内容类别同级且用户只需查看其中一个面板时使用 Tabs。
推荐
- 标签短且互不重叠。
- 默认激活最常用或最安全的面板。
避免
- 不要用 Tabs 隐藏必须按顺序完成的步骤。
代码演示
基础用法
General settings.
Security settings.
Billing settings.
卡片变体与尺寸
General settings.
Security settings.
General settings.
Security settings.
General settings.
Security settings.
受控与禁用标签页
General settings.
Security settings.
Unavailable.
外部控制标签页
通过 activeKey 与 onChange 把标签页状态纳入应用逻辑。
General settings content.
Security settings content.
Notification preferences.
activeKey: security
禁用标签页
禁用暂不可访问的内容入口,其他标签仍可切换。
This tab works.
This too.
Cannot reach.
卡片标签尺寸
组合卡片变体与不同尺寸,对比密度与内容区域。
small
General settings content.
Security settings content.
Notification preferences.
medium
General settings content.
Security settings content.
Notification preferences.
large
General settings content.
Security settings content.
Notification preferences.
全局尺寸与局部覆盖
继承 Provider 的尺寸,并在需要时为某组标签显式覆盖。
General settings content.
Security settings content.
Notification preferences.
切换时销毁内容
比较保留内容和销毁内容的行为;在面板中输入后切换可观察状态是否保留。
Only this panel is in DOM when active.