Search Field

Un campo di ricerca con lente e pulsante per cancellare; Invio invia ed Esc cancella. Funziona come controllo di modulo.

Disponibile in
  • Angular: disponibile
  • Vue: disponibile
  • React: disponibile
  • React Native: disponibile

Utilizzo

Searched for: nothing yet

Importazione

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

Riferimento API

SoneSearchFieldComponentComponente

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

Selettore
sone-search-field
Esporta come
soneSearchField
Input
NomeTipo Predefinito
valuebidirezionale

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
Output
NomeTipo
submit

Enter was pressed; carries the current text.

string
escape

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

void