Toggle Group & Tabs

Przełączniki, grupy przełączników i karty z wędrującym fokusem, w każdej orientacji.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: dostępny

Użycie

Overview content goes here.

Import

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

Dokumentacja API

SoneTabsListDirectiveDyrektywa

Selektor
[soneTabsList]
Wejścia
NazwaTyp Domyślnie
variantTabsVariant"default"
orientationToggleOrientation"horizontal"
stretch

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

booleanfalse

SoneTabsTriggerDirectiveDyrektywa

Selektor
[soneTabsTrigger]
Wejścia
NazwaTyp Domyślnie
activebooleanfalse
iconbooleanfalse

SoneToggleDirectiveDyrektywa

Selektor
[soneToggle]
Wejścia
NazwaTyp Domyślnie
variantToggleVariant"default"
sizeToggleSize"default"
pressedbooleanfalse

SoneToggleGroupDirectiveDyrektywa

`[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`.

Selektor
[soneToggleGroup]
Wejścia
NazwaTyp Domyślnie
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
valuedwukierunkowe

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

ToggleGroupValuenull
disabled

Every item disabled.

booleanfalse

SoneToggleGroupItemDirectiveDyrektywa

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

Selektor
[soneToggleGroupItem]
Wejścia
NazwaTyp Domyślnie
pressedbooleanfalse
value

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

string | nullnull
disabledbooleanfalse