import { Search } from "@wfp/react"; () => { return ( <Search name="search" onClear="() => console.log('The search was cleared')" placeholder="search here" /> ); };
string |number
string
Specify an optional className to be applied to the form-item node
Provide a custom className that is applied directly to the underlying <input> or <textarea> node
boolean
Specify whether you want the underlying label to be visually hidden
The text for the close Button
Specify if the control should be disabled, or not
Provide a unique identifier for the control
"main" |"small" |"light" |"large" |"banner"
Specify a style for the search input
(event?: ChangeEvent<HTMLInputElement>,value?: string) => void
The new value is available first arg 'searchValue' and evt object if needed is on second arg. i.e. const handleChange = (searchValue, evt) => { console.log("searchValue", searchValue); // a string console.log("evt", evt); // the whole event object }
() => void
true to use the small version of Search
true
An optional class to apply additional styling to the wrapper
Provide a function that is called when the search input is cleared
ReactNode
Provide text that is used alongside the control label for additional help
Provide the text that will be read by a screen reader when visiting this control
any
Specify whether the control is currently invalid. Either a boolean in combination with invalidText or an object( eg. { message: "Message", …otherErrorProperties }) can be passed.
invalidText
object
Provide the text that is displayed when the control is in an invalid state
Provide the content that will be shown in addition to the label (e.g. units, currency, etc.) This content will be placed after the label
Specify the placeholder attribute for the input
Provide a name for the control
Specify if the control is required (sets aria-invalid as well)
If the input is read-only, the user cannot change its value but focus and tabIndex are still applied (sets aria-readonly as well)
Renders the input as inline element for horizontal forms
Additional helper in front of the input, e.g. a currency symbol (sets aria-describedby as well)
Additional helper behind the input, e.g. a currency symbol (sets aria-describedby as well)
AddonBeforeAddonAfterLabelHelperTextInlineErrorMessage
Supports replacement components