Skip to main content
Version: 1.x

@microsoft/fast-foundation > Search

Search class

A Search Custom HTML Element. Based largely on the <input type="search" /> element.

start - Content which can be provided before the search input

end - Content which can be provided after the search clear button

  • The default slot for the label

close-button - The clear button

close-glyph - The clear glyph

label - The label

root - The element wrapping the control, including start and end slots

control - The element representing the input

clear-button - The button to clear the input

Signature:
export declare class Search extends FormAssociatedSearch 

Properties

PropertyModifiersTypeDescription
autofocusbooleanIndicates that this element should get focus after the page finishes loading. See autofocus HTML attribute for more information.
liststringAllows associating a datalist to the element by https://developer.mozilla.org/en-US/docs/Web/API/Element/id.
maxlengthnumberThe maximum number of characters a user can enter.
minlengthnumberThe minimum number of characters a user can enter.
patternstringA regular expression that the value must match to pass validation.
placeholderstringSets the placeholder value of the element, generally used to provide a hint to the user.
readOnlybooleanWhen true, the control will be immutable by user interaction. See readonly HTML attribute for more information.
sizenumberSets the width of the element to a specified number of characters.
spellcheckbooleanControls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used.

Methods

MethodModifiersDescription
handleClearInput()Handles the control's clear value event