Lucent UI
← TextareaSearchInputSelect →
✦ LLM-ready

SearchInput

atom

Text field with a leading search icon and an inline results dropdown. Supports label, helper text, and error state. Suitable for filtering, look-ups, and autocomplete flows.

"Add a SearchInput from lucent-ui. Filter a local array based on the input value and show matching results in the dropdown."

Usage

React / JSX
import { SearchInput } from 'lucent-ui'

<SearchInput size="md" label="SearchInput" placeholder="SearchInput" />

Installation

pnpm add lucent-ui

API Reference

SearchInput props — * required

PropTypeDefaultDescription
value*string—Controlled search query.
onChange*(value: string) => void—Called on every keystroke.
size"sm" | "md" | "lg""md"Height and font scale — passed through to the underlying Input.
labelstring—Label displayed above the search input.
helperTextstring—Hint or description below the input.
errorTextstring—Error message; triggers the error visual state.
placeholderstring—Hint text when empty.
resultsArray<{ id: number | string; label: string }>—Dropdown options to display.
onResultSelect(result: { id: number | string; label: string }) => void—Called when the user clicks a result.
isLoadingbooleanfalseShows a spinner in the dropdown.
disabledbooleanfalsePrevents interaction.