Rail

页面旁的一列窄图标按钮,用于应用级位置:当前位置凸起显示,带提示文字以及“进行中”“需关注”“正常”徽标。

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

用法

Current place: home

导入

ts
import {
  SoneRailButtonComponent,
  SoneRailComponent,
  SoneRailGroupDirective,
} from "@surface-one/angular/rail";

API 参考

SoneRailButtonComponent组件

`<sone-rail-button>` — one place on a rail: a square icon button whose `label` is its accessible name and its tooltip (`title`). `current` marks the place on screen (`aria-current="page"`): a raised island with the accent icon. `badge` adds a status dot in the corner (busy pulses); say the status in the label when it matters.

选择器
sone-rail-button
输入
名称类型 默认值
icon必填ShellIcon—
label必填

The accessible name and the tooltip.

string—
current

The place on screen now (`aria-current="page"`).

booleanfalse
badge

A status dot in the corner.

RailBadge | nullnull
disabledbooleanfalse

SoneRailComponent组件

`<sone-rail>` — a narrow column of icon buttons beside the page (on the glass in the Surface skin): app-level places such as Home, Search or Settings. A `nav` landmark named by `ariaLabel`; put the buttons in `[soneRailGroup]` blocks — the first group sits at the top, the last at the bottom.

选择器
sone-rail
输入
名称类型 默认值
ariaLabel

Names the navigation landmark.

string$localize`:The rail's navigation landmark:Main`

SoneRailGroupDirective指令

A column of rail buttons; the rail spreads its groups from top to bottom.

选择器
[soneRailGroup]