Dock

Pasek narzędzi do rysowania przypinany do górnej, dolnej, lewej lub prawej krawędzi płótna, z nawigacją strzałkami i podpowiedziami.

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

Użycie

Tool: select · Tab into the dock, then use the arrow keys.

Import

ts
import {
  SoneDockComponent,
  SoneDockGroupDirective,
  SoneDockItemDirective,
  SoneDockSeparatorDirective,
} from "@surface-one/angular/dock";

Dokumentacja API

SoneDockComponentKomponent

A toolbar of drawing tools docked to one edge of a canvas — `position` picks the edge (top, bottom, left, right) and with it the direction: a row on top or bottom, a column on the sides. `floating` (the default) pins it inside the nearest positioned ancestor; without it the dock sits in the flow. A WAI-ARIA toolbar: one Tab stop, arrow keys along its direction, Home / End.

Selektor
sone-dock
Wejścia
NazwaTyp Domyślnie
position

The edge it docks to.

DockPosition"bottom"
align

Where along that edge: centred, or at its start or end.

DockAlign"center"
sizeDockSize"default"
floating

Pin to the edge of the nearest positioned ancestor (`position: relative`).

booleantrue
ariaLabelstring$localize`:Toolbar of drawing tools:Tools`

SoneDockGroupDirectiveDyrektywa

A labelled run of related tools (`role="group"`).

Selektor
[soneDockGroup]
Wejścia
NazwaTyp Domyślnie
soneDockGroupstring | nullnull

SoneDockItemDirectiveDyrektywa

One tool of a dock — an icon button named by `label`, which is also its tooltip (with the `shortcut`, if any). `[active]` makes it a toggle (`aria-pressed`): the current drawing tool. Leave it unset for a plain action (zoom, undo).

Selektor
button[soneDockItem]
Wejścia
NazwaTyp Domyślnie
labelwymagane

The accessible name and the tooltip.

string—
shortcut

A key that picks the tool (`V`, `Shift+R`) — shown in the tooltip, announced as `aria-keyshortcuts`.

string | nullnull
active

`true` / `false`: a toggle; unset: a plain button.

boolean | undefinedundefined
disabledbooleanfalse

SoneDockSeparatorDirectiveDyrektywa

A rule between groups of tools, across the dock's direction.

Selektor
[soneDockSeparator]