Search Field

虫眼鏡アイコンとクリアボタン付きの検索ボックス。Enter で送信、Esc でクリア。フォームコントロールとして使えます。

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

使い方

Searched for: nothing yet

インポート

ts
import {
  SoneSearchFieldComponent,
} from "@surface-one/angular/search-field";

API リファレンス

SoneSearchFieldComponentコンポーネント

`<sone-search-field>` — a search box on the Input Group: a leading search glyph, the field (`role="searchbox"`) and, when `clearable` and not empty, a clear button at the end. A form control (ControlValueAccessor) or `[(value)]`. Enter emits `(submit)` with the current text. Escape clears a `clearable` field that has text; on an empty (or non-clearable) field it emits `(escape)` — close the panel that holds it there. `focus()` focuses the field.

セレクター
sone-search-field
エクスポート名
soneSearchField
入力
名前型 デフォルト
value双方向

The search text (`[(value)]`).

string""
sizeSearchFieldSize"default"
variant

`filled`: a grey fill and no border (Isles' search box); it takes the field colour on focus and keeps the focus ring. The search glyph and the placeholder identify it in place of a 3:1 border.

SearchFieldVariant"default"
placeholder—$localize`Search`
ariaLabel

The field's accessible name.

string | null$localize`Search`
inputIdstring | nullnull
namestring | nullnull
clearable

Shows a clear button while the field has text; Escape clears it too.

booleanfalse
clearLabel

The clear button's accessible name.

—$localize`Clear search`
disabledbooleanfalse
出力
名前型
submit

Enter was pressed; carries the current text.

string
escape

Escape was pressed on an empty or non-clearable field.

void