Mixins / foldkit-mixins-ui

SearchFieldView

interface · packages/mixins-ui/src/searchField.ts:89

interface SearchFieldView<Message> extends Adornments {
  readonly id: string
  readonly label: string
  readonly value: string
  readonly onInput: OnInput<NoInfer<Message>>
  readonly clear?:
    | {
        readonly onClear: NoInfer<Message>
        readonly content?: Html | undefined
      }
    | undefined
  readonly busy?: boolean | undefined
  readonly placeholder?: string | undefined
  readonly invalid?: boolean | undefined
  readonly disabled?: boolean | undefined
  readonly words?: SearchFieldWords | undefined
  readonly routes?: ReadonlyArray<Route<NoInfer<Message>>> | undefined
  readonly style?: NamedStyle<typeof SearchFieldSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

Members

SearchFieldView.id

property · packages/mixins-ui/src/searchField.ts:91

readonly id: string

Prefixes the ids the field draws, unique on the page.

SearchFieldView.label

property · packages/mixins-ui/src/searchField.ts:93

readonly label: string

The input's accessible name: a search field wears no visible label.

SearchFieldView.value

property · packages/mixins-ui/src/searchField.ts:94

readonly value: string

SearchFieldView.onInput

property · packages/mixins-ui/src/searchField.ts:96

readonly onInput: OnInput<NoInfer<Message>>

What typing sends; a resumable builder's OnInput attribute names it in the server's markup.

SearchFieldView.clear

property · packages/mixins-ui/src/searchField.ts:102

readonly clear?:
  | {
      readonly onClear: NoInfer<Message>
      readonly content?: Html | undefined
    }
  | undefined

The clear button and Escape's clearing: with none, the field has neither. onClear is sent by both on a field with text; answer it with Focus. content is drawn in the button in place of the cross.

SearchFieldView.busy

property · packages/mixins-ui/src/searchField.ts:106

readonly busy?: boolean | undefined

A search is running: aria-busy on the input and data-busy on the field. Compose a spinner into end.

SearchFieldView.placeholder

property · packages/mixins-ui/src/searchField.ts:107

readonly placeholder?: string | undefined

SearchFieldView.invalid

property · packages/mixins-ui/src/searchField.ts:108

readonly invalid?: boolean | undefined

SearchFieldView.disabled

property · packages/mixins-ui/src/searchField.ts:110

readonly disabled?: boolean | undefined

A disabled field takes no text or keys and draws no clear button.

SearchFieldView.words

property · packages/mixins-ui/src/searchField.ts:111

readonly words?: SearchFieldWords | undefined

SearchFieldView.routes

property · packages/mixins-ui/src/searchField.ts:117

readonly routes?: ReadonlyArray<Route<NoInfer<Message>>> | undefined

Keys the application answers in the field, such as ArrowDown opening results. They share one keydown owner with Escape: a route on the same gesture as another is a diagnostic naming both.

SearchFieldView.style

property · packages/mixins-ui/src/searchField.ts:119

readonly style?: NamedStyle<typeof SearchFieldSlots> | undefined

A style of SearchFieldSlots, for the field's look.

SearchFieldView.mixins

property · packages/mixins-ui/src/searchField.ts:121

readonly mixins?: MixinList<Message> | undefined

Mixins beside the style; an input-driven one reads the text.