- Boolean props are now prefixed by
is
. - There is no longer a loading state.
icon
prop has been renamed toprefix
.- Button props have been removed. To add a clear button, use the
isClearable
prop. For a more complex use case, create your own input using InputGroup. wrapperProps
no longer exists.validationState
has been changed toisInvalid
.
SearchField
A search field is a specialized text input allowing the user to perform a search.
Usage
Disabled
A search field in a disabled state shows that an input field exists, but is not available in that circumstance. This can be used to maintain layout continuity and communicate that a field may become available later.
ReadOnly
The isReadOnly
prop makes the SearchField's text content immutable. Unlike isDisabled
, the search field remains focusable and the contents can still be copied. See the MDN docs for more information.
Error
A search field can be displayed in an error state to indicate that the user input is invalid.
Hide Clear Button
A search field can hide its clear button.
Sizes
Search fields have multiple sizes to choose from.
Labeling
If a visible label isn't specified, an aria-label
must be provided to the search field for accessibility. If the field is labeled by a separate element, an aria-labelledby
prop must be provided using the ID of the labeling element instead.
Description
A search field with a helper message.
Props
- isClearable?
- placeholder?
- isFluid?
- icon?
- inputRef?
- inputGroupProps?
- clearButtonProps?
- style?
- pattern?
- validationBehavior?
- onSubmit?
- onClear?
- isDisabled?
- isReadOnly?
- isRequired?
- isInvalid?
- validate?
- autoFocus?
- value?
- defaultValue?
- onChange?
- id?
- autoComplete?
- maxLength?
- minLength?
- type?
- inputMode?
- name?
- className?
- description?
- errorMessage?
- label?
- necessityIndicator?
- size?
Whether the SearchField is clearable.
The placeholder text when the SearchField is empty.
If true
, the SearchField will take all available width.
An icon to display at the start of the input.
A ref for the HTML input element.
The props for the InputGroup.
The props for the EmbeddedButton.
The inline style for the element. A function may be provided to compute the style based on component state.
Regex pattern that the value of the input must match to be valid. See MDN.
Whether to use native HTML form validation to prevent form submission when the value is missing or invalid, or mark the field as required or invalid via ARIA.
Handler that is called when the SearchField is submitted.
Handler that is called when the clear button is pressed.
Whether the input is disabled.
Whether the input can be selected but not changed by the user.
Whether user input is required on the input before form submission.
Whether the input value is invalid.
A function that returns an error message if a given value is invalid.
Validation errors are displayed to the user when the form is submitted
if validationBehavior="native"
. For realtime validation, use the isInvalid
prop instead.
Whether the element should receive focus on render.
The current value (controlled).
The default value (uncontrolled).
Handler that is called when the value changes.
The element's unique identifier. See MDN.
Describes the type of autocomplete functionality the input should provide if any. See MDN.
The maximum number of characters supported by the input. See MDN.
The minimum number of characters required by the input. See MDN.
The type of input to render. See MDN.
Hints at the type of data that might be entered by the user while editing the element or its contents. See MDN.
The name of the input element, used when submitting an HTML form. See MDN.
The CSS className for the element. A function may be provided to compute the class based on component state.
The helper message of the field.
The error message of the field.
The label of the field.
Whether the required state should be shown as an asterisk or a label, which would display (Optional) on all non required field labels.
A CheckboxGroup can vary in size.
- onFocus?
- onBlur?
- onFocusChange?
- onKeyDown?
- onKeyUp?
- onCopy?
- onCut?
- onPaste?
- onCompositionStart?
- onCompositionEnd?
- onCompositionUpdate?
- onSelect?
- onBeforeInput?
- onInput?
Handler that is called when the element receives focus.
Handler that is called when the element loses focus.
Handler that is called when the element's focus status changes.
Handler that is called when a key is pressed.
Handler that is called when a key is released.
Handler that is called when the user copies text. See MDN.
Handler that is called when the user cuts text. See MDN.
Handler that is called when the user pastes text. See MDN.
Handler that is called when a text composition system starts a new text composition session. See MDN.
Handler that is called when a text composition system completes or cancels the current text composition session. See MDN.
Handler that is called when a new character is received in the current text composition session. See MDN.
Handler that is called when text in the input is selected. See MDN.
Handler that is called when the input value is about to be modified. See MDN.
Handler that is called when the input value is modified. See MDN.
- aria-activedescendant?
- aria-autocomplete?
- aria-haspopup?
- aria-label?
- aria-labelledby?
- aria-describedby?
- aria-details?
- excludeFromTabOrder?
- aria-errormessage?
Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.
Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
Defines a string value that labels the current element.
Identifies the element (or elements) that labels the current element.
Identifies the element (or elements) that describes the object.
Identifies the element (or elements) that provide a detailed, extended description for the object.
Whether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available.
Identifies the element that provides an error message for the object.
- slot?
A slot name for the component. Slots allow the component to receive props from a parent component.
An explicit null
value indicates that the local props completely override all props received from a parent.