Toggle Group & Tabs

Toggles, toggle groups and tabs with roving focus and every orientation.

Available in
  • Angular: available
  • Vue: available
  • React: available
  • React Native: available

Usage

Overview content goes here.

Import

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

API reference

SoneTabsListDirectiveDirective

Selector
[soneTabsList]
Inputs
NameType Default
variantTabsVariant"default"
orientationToggleOrientation"horizontal"
stretch

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

booleanfalse

SoneTabsTriggerDirectiveDirective

Selector
[soneTabsTrigger]
Inputs
NameType Default
activebooleanfalse
iconbooleanfalse

SoneToggleDirectiveDirective

Selector
[soneToggle]
Inputs
NameType Default
variantToggleVariant"default"
sizeToggleSize"default"
pressedbooleanfalse

SoneToggleGroupDirectiveDirective

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

Selector
[soneToggleGroup]
Inputs
NameType Default
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
valuetwo-way

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

ToggleGroupValuenull
disabled

Every item disabled.

booleanfalse

SoneToggleGroupItemDirectiveDirective

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

Selector
[soneToggleGroupItem]
Inputs
NameType Default
pressedbooleanfalse
value

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

string | nullnull
disabledbooleanfalse