Skip to main content

Examples

Default

With Label

All States

Text Overflow

With Clear Button

Props

SearchField

A text input field with a search icon and optional clear button.
ReactNode
Trailing interactive element pinned to the right edge — typically a Chip or Button (the “with button” field type). Reduces the right padding so the control sits flush, and clicks on it do not steal focus from the input.
number
Debounce delay in milliseconds for the onChange callback. When set, the input maintains internal state for responsive typing while debouncing onChange to the parent.
boolean
default:"false"
Whether the text field is in an error state.
string
Error message displayed below the input. Shown instead of helperText when error is true.
boolean
default:"false"
Whether the text field stretches to fill its container width.
string
Helper text displayed below the input. Replaced by errorMessage when error is true.
string
Label text displayed above the input. Also used as the accessible name.
ReactNode
Fixed, non-editable label pinned inside the left edge of the field — for a prefix such as a currency symbol or country code.
number
Minimum number of characters required before onChange fires. The input still updates visually, but onChange is suppressed until the threshold is met. Clearing always fires onClear regardless.
(() => void)
Callback fired when the clear button is clicked. If provided, a clear button appears when the field has a value.
ReactNode
Icon element displayed at the right side of the input.
ReactNode
Fixed, non-editable label pinned inside the right edge of the field — for a unit or suffix such as a currency code or domain.
"32" | "40" | "48"
default:"48"
Size variant of the search field.
boolean
default:"false"
Whether the text field is validated.

Exported types

Also exported from @fanvue/ui: SearchFieldProps, SearchFieldSize.
Setup: Installation · Theming