DebounceInput

DebounceInput is a omponent that wraps an input field with debounce functionality. This means that the input value will only be processed after a specified delay, reducing the frequency of expensive operations like API calls or state updates while typing.

Example

Example usage

API

Container
PropDescriptionTypeDefault
wait Time interval that will wait before invoking the onChange event after the user stops typing.number500
disabledWhether the Input is disabledboolean-
invalidWhether the Input is invalid statusboolean-
onBlurCallback when Input remove focus(e: MouseEvent) => void-
onChangeCallback when Input value changed(e: MouseEvent) => void-
onFocusCallback when Input is focused(e: MouseEvent) => void-
prefixRender a prefix content inside Inputstring | ReactNode-
sizeInput size'lg' | 'md' | 'sm''md'
suffixRender a suffix content inside Inputstring | ReactNode-
textAreaWhether to turn Input into textarea fieldboolean-
typeInput type, refer to MDN for available typesstring'text'
unstyleWhether to remove input default stylebooleanfalse