Search Field

Un cuadro de búsqueda con lupa y botón para borrar; Enter envía y Escape borra. Funciona como control de formulario.

Disponible en
  • Angular: disponible
  • Vue: disponible
  • React: disponible
  • React Native: disponible

Uso

Searched for: nothing yet

Importación

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

Referencia de la 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.

Selector
sone-search-field
Exportar como
soneSearchField
Inputs
NombreTipo Predeterminado
valuebidireccional

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
Outputs
NombreTipo
submit

Enter was pressed; carries the current text.

string
escape

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

void