Components · Form & Input
Search Input
StableAdded v0.0.1
A text input pre-wired with a search icon and a clear button for filtering content.
import { SearchInput } from '@nexub/react';Playground
Props
<SearchInput placeholder="Search…" />Examples
Default
States
defaultinvalidloadingsize="sm"size="md"size="lg"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| placeholder | string | — | Placeholder text shown when empty. |
| value | string | — | Controlled value of the search field. |
| onClear | (() => void) | — | Called when the user clicks the clear button. |
| size | 'sm' | 'md' | 'lg' | — | Controls font size and padding. |
| clearable | boolean | — | Shows a clear button while there is a value. Clearing fires onChange with "". |
| invalid | boolean | — | |
| leadingAddon | string | — | |
| loading | boolean | — | Spinner in the trailing slot and aria-busy on the input. |
| showCount | boolean | — | Shows a "12/80" counter; needs maxLength. Announced politely near the limit. |
| trailingAddon | string | — | |
| wrapperClassName | string | — |
On iOS & Android: SearchField
@nexub/react-nativeAlpha
import { SearchField } from '@nexub/react-native';
<SearchField label="Search transactions" onChangeText={setQuery} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Name | SearchInput. | SearchField, with the platform search keyboard and clear button. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
SearchField props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | messages.search | Accessible name. |
| size | TextFieldProps['size'] | 'md' | — |
| ref | React.Ref<React.ComponentRef<typeof TextInput>> | — | — |
| helperText | string | — | Hint under the field. Replaced by error when set. |
| error | string | — | Error message: red outline, announced, replaces the helper text. |
| required | boolean | — | Shows a required marker after the label, like web FormField. Checking the value is up to you. |
| disabled | boolean | — | — |
| invalid | boolean | — | Red outline and announced as invalid, with or without an error message. |
| readOnly | boolean | — | Shows the value but it can't be changed. The field can still be focused and its text selected and copied; it sits on a quieter surface so it doesn't look editable. |
| leadingIcon | React.ReactNode | — | An icon (or any small node) at the start, inside the field. |
| trailingIcon | React.ReactNode | — | An icon (or any small node) at the end, inside the field, after the clear button. |
| leadingAddon | React.ReactNode | — | Text or a node in its own segment before the field, e.g. "https://". |
| trailingAddon | React.ReactNode | — | Text or a node in its own segment after the field, e.g. ".com" or "kg". |
| leading | React.ReactNode | — | The older name for leadingIcon: a node at the start, inside the field. |
| trailing | React.ReactNode | — | The older name for trailingIcon: a node at the end, inside the field. |
| onClear | () => void | — | Called when the clear button empties the field, after onChangeText(""). |
| showCount | boolean | — | Shows a "12/80" counter; needs maxLength. Announced politely near the limit. |
| loading | boolean | — | Spinner in the trailing slot and busy for screen readers. |
| streaming | boolean | — | 12.5: an agent is filling this field. Busy for screen readers, with a calm shimmer on the field (none under Reduce Motion); it stays editable. Pass the value as it arrives. |
| style | StyleProp<ViewStyle> | — | — |