Tab Strip

桌面窗口的文档标签:每个标签带状态圆点和简短备注,有关闭和新建标签按钮,可用方向键切换,用 Delete 或 ⌘W 关闭。

可用框架
  • Angular: 可用
  • Vue: 可用
  • React: 可用
  • React Native: 暂不可用

用法

3 open

Agent run

导入

ts
import {
  SoneTabStripComponent,
  SoneTabStripTrailingDirective,
} from "@surface-one/angular/tab-strip";

API 参考

SoneTabStripComponent组件

`<sone-tab-strip>` — document tabs for a desktop window (the WAI-ARIA Tabs pattern): a `tablist` of `tabs`, the selected one `[(active)]`, each with an optional status dot (`busy` pulses) and a short note. `closable` gives every tab a close button — a sibling of the tab, so the tab stays one control — and `addable` a "New tab" button. ←/→, Home and End move between tabs; Delete or ⌘W closes the focused one. Each tab points at its panel: `id="<panelIdPrefix>-<tab id>"`, labelled by `<panelIdPrefix>-tab-<tab id>`.

选择器
sone-tab-strip
输入
名称类型 默认值
tabsreadonly TabStripTab[][]
active双向

The selected tab's id — `[(active)]`.

string | nullnull
ariaLabel

Names the tab list.

string$localize`:A tab strip's tab list:Tabs`
closable

Gives every tab a close button (and Delete / ⌘W).

booleanfalse
addable

Shows the "New tab" button after the tabs.

booleanfalse
panelIdPrefix

The id prefix the panels use, so each tab can point at its panel.

string"tab-panel"
输出
名称类型
close

A tab's close button or Delete / ⌘W on it: the parent removes it and picks the new active tab.

string
add

The "New tab" button.

void

SoneTabStripTrailingDirective指令

Content after the tabs, pushed to the end of the strip (a search, an account).

选择器
[soneTabStripTrailing]