Search Field

Pole wyszukiwania z ikoną lupy i przyciskiem czyszczenia; Enter wysyła, Escape czyści. Działa jako kontrolka formularza.

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

Użycie

Searched for: nothing yet

Import

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

Dokumentacja API

SoneSearchFieldComponentKomponent

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

Selektor
sone-search-field
Eksport jako
soneSearchField
Wejścia
NazwaTyp Domyślnie
valuedwukierunkowe

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
Wyjścia
NazwaTyp
submit

Enter was pressed; carries the current text.

string
escape

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

void