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