Toggle Group & Tabs

トグル、トグルグループ、タブ。ロービングフォーカスとあらゆる向きに対応します。

対応フレームワーク
  • Angular: 対応
  • Vue: 対応
  • React: 対応
  • React Native: 対応

使い方

Overview content goes here.

インポート

ts
import {
  SoneTabsListDirective,
  SoneTabsTriggerDirective,
  SoneToggleDirective,
  SoneToggleGroupDirective,
  SoneToggleGroupItemDirective,
} from "@surface-one/angular/toggle-group";

API リファレンス

SoneTabsListDirectiveディレクティブ

セレクター
[soneTabsList]
入力
名前型 デフォルト
variantTabsVariant"default"
orientationToggleOrientation"horizontal"
stretch

Fill the container's width, every trigger an equal share.

booleanfalse

SoneTabsTriggerDirectiveディレクティブ

セレクター
[soneTabsTrigger]
入力
名前型 デフォルト
activebooleanfalse
iconbooleanfalse

SoneToggleDirectiveディレクティブ

セレクター
[soneToggle]
入力
名前型 デフォルト
variantToggleVariant"default"
sizeToggleSize"default"
pressedbooleanfalse

SoneToggleGroupDirectiveディレクティブ

`[soneToggleGroup]` — a set of toggle buttons; arrow keys move between them. Without `type`, each item takes its own `pressed`. With `type="single"` or `"multiple"` the group presses the items that carry a `value`, two-way through `[(value)]`, and becomes one Tab stop (roving tabindex: the last focused item, else the first pressed one); items keep `aria-pressed`.

セレクター
[soneToggleGroup]
入力
名前型 デフォルト
variantToggleVariant"default"
sizeToggleSize"default"
spacingnumber0
orientationToggleOrientation"horizontal"
stretch

Fill the container's width on one row, every item an equal share.

booleanfalse
type

The group presses its items (`single` / `multiple`); unset, each item's `pressed` decides.

ToggleGroupType | nullnull
value双方向

The pressed value (`single`, `null` for none) or values (`multiple`), two-way.

ToggleGroupValuenull
disabled

Every item disabled.

booleanfalse

SoneToggleGroupItemDirectiveディレクティブ

`[soneToggleGroupItem]` — takes its variant, size and (with a `value` in a typed group) pressed state from the group.

セレクター
[soneToggleGroupItem]
入力
名前型 デフォルト
pressedbooleanfalse
value

Its value in a group with `type`: the group presses it.

string | nullnull
disabledbooleanfalse