Tag Input

タグを削除可能なチップとして入力します。Enter またはカンマで追加、Backspace で最後のタグを削除。フォームコントロールとして使えます。

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

使い方

  • design
  • planning
  • q3

Press Enter or type a comma to add a tag.

インポート

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

API リファレンス

SoneTagInputComponentコンポーネント

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.

セレクター
sone-tag-input
入力
名前型 デフォルト
value双方向readonly 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
出力
名前型
addedstring
removedstring
rejectedSoneTagRejection