Tag Input

Wpisywanie tagów jako usuwalnych etykiet — Enter lub przecinek dodaje, Backspace usuwa ostatni — jako kontrolka formularza.

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

Użycie

  • design
  • planning
  • q3

Press Enter or type a comma to add a tag.

Import

ts
import {
  SoneTagInputComponent,
} from "@surface-one/angular/tag-input";

Dokumentacja API

SoneTagInputComponentKomponent

Tags as removable chips — a ControlValueAccessor of `string[]`. Enter or a comma adds the typed tag (a pasted "a, b, c" adds three), Backspace in the empty field removes the last one. Duplicates are refused case-insensitively.

Selektor
sone-tag-input
Wejścia
NazwaTyp Domyślnie
valuedwukierunkowereadonly string[][]
placeholderstring""
ariaLabel

The text field's accessible name.

string | null$localize`Add tag`
inputIdstring | nullnull
max

At most this many tags; further ones are rejected with reason `max`.

number | nullnull
maxVisible

Show this many chips and a "+N more" toggle for the rest.

number | nullnull
suggestions

Offered while typing (a native `<datalist>`).

readonly string[][]
validate

Return `false` to refuse a tag (reason `invalid`).

((tag: string) => boolean) | nullnull
variant

The chips' badge variant.

BadgeVariant"secondary"
disabledbooleanfalse
invalidbooleanfalse
Wyjścia
NazwaTyp
addedstring
removedstring
rejectedSoneTagRejection