Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

SearchInput

Filter a documentation list with controlled search text.

Preview

Live preview

Changes apply to this preview only.

Search the documentation

Results filter as you type. Enter records the query; Escape clears the field.

5 results
InstallationGetting started

Install the workspace, build the generated tokens and start the playground.

Theme builderDesign system

Try a preset, a colour mode, a brand colour, a radius and a density.

SearchInputForms

A search field with a keyboard hint, a clear action and Enter to submit.

CodeBlockTypography

Documentation samples with line numbers, highlights and copy feedback.

Design tokensDesign system

Primitive colours, spacing and radii feeding the semantic theme aliases.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Basic

The shortcut is rendered as a Kbd; it is a hint, not a global key binding.

Open preview

Sizes

sm, md and lg reuse the Input height and type scale.

Open preview

Controlled and states

A controlled field follows its value; disabled, non-clearable and custom clear labels are supported.

Open preview

Usage

Keep the query and result set synchronized, including the clear action.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluSearchInputProps

Type source
PimoluSearchInputProps public API
NameTypeDefaultDescription
valuestring | undefined—Controlled query.
defaultValuestring | undefined—Initial query when uncontrolled.
onValueChange((value: string) => void) | undefined—Called with every next query, including clear and Escape.
onSearch((value: string) => void) | undefined—Called with the current query when Enter is pressed.
placeholderstring | undefined"Search…"Placeholder text. Defaults to "Search…".
shortcutstring | undefined—Keyboard hint rendered as a Kbd, for example "/" or "⌘K".
clearableboolean | undefinedtrueShow the accessible clear button. Defaults to true.
clearLabelstring | undefined"Clear search"Accessible name for the clear button.
size"sm" | "md" | "lg" | undefined"md"Height and type scale. Defaults to "md".
labelstring | undefined—Visible label, also used as the accessible name.
aria-labelstring | undefined—Accessible name when no visible label is supplied.
aria-describedbystring | undefined—Additional accessible description.
disabledboolean | undefinedfalseDisable the field and its actions.
classNamestring | undefined—Class applied to the outer wrapper.
namestring | undefined—Native input name, useful inside a form.
autoCompletestring | undefined—Forwarded to the native input.
autoFocusboolean | undefined—Focus the field on mount.
idstring | undefined—Native input id, when an external label points at it.
value

string | undefined

No default extracted.

Controlled query.

defaultValue

string | undefined

No default extracted.

Initial query when uncontrolled.

onValueChange

((value: string) => void) | undefined

No default extracted.

Called with every next query, including clear and Escape.

onSearch

((value: string) => void) | undefined

No default extracted.

Called with the current query when Enter is pressed.

placeholder

string | undefined

Default: "Search…"

Placeholder text. Defaults to "Search…".

shortcut

string | undefined

No default extracted.

Keyboard hint rendered as a Kbd, for example "/" or "⌘K".

clearable

boolean | undefined

Default: true

Show the accessible clear button. Defaults to true.

clearLabel

string | undefined

Default: "Clear search"

Accessible name for the clear button.

size

"sm" | "md" | "lg" | undefined

Default: "md"

Height and type scale. Defaults to "md".

label

string | undefined

No default extracted.

Visible label, also used as the accessible name.

aria-label

string | undefined

No default extracted.

Accessible name when no visible label is supplied.

aria-describedby

string | undefined

No default extracted.

Additional accessible description.

disabled

boolean | undefined

Default: false

Disable the field and its actions.

className

string | undefined

No default extracted.

Class applied to the outer wrapper.

name

string | undefined

No default extracted.

Native input name, useful inside a form.

autoComplete

string | undefined

No default extracted.

Forwarded to the native input.

autoFocus

boolean | undefined

No default extracted.

Focus the field on mount.

id

string | undefined

No default extracted.

Native input id, when an external label points at it.

Accessibility

  • Label search and expose result feedback without announcing every keystroke assertively.
Read the accessibility guide →