Skip to content
RefineUI

Search Field

Input control tuned for query entry with clear action.

Sizes

Overview

Machine-readable contract from Component Spec.

component: search-fieldexport: SearchFieldversion: 1attributes: data-refineui=search-field

Anatomy

Partdata-refineui
rootsearch-field
clearsearch-field-clear
iconsearch-field-icon
inputsearch-field-input

Variants

AxisValues
appearancefilled, plain
sizesm, md, lg

States

ScopeCategoryValues
componentpseudofocus-visible
componentenvironmentforced-colors, dir

Accessibility

SlotElementNative
search-field-inputinputtrue
search-field-clearbuttontrue

Keyboard

KeyActionNative
Escapeclose—

Focus

SectionPropertyValue
visualrequiredtrue
visualselector:focus-visible

Layout

PropertyValue
directionlogical
rtltrue
npm install @refineui/react @refineui/tokens
import { SearchField, SearchFieldIcon, SearchFieldInput, SearchFieldClear } from "@refineui/react";
<SearchField value={query} onValueChange={setQuery} />
<SearchField
value={searchTerm}
onValueChange={setSearchTerm}
appearance="filled"
aria-label="Search products"
/>
<SearchField appearance="plain" defaultValue="initial query" />
<SearchField size="lg" aria-label="Search everything" />

Sizes match Input (sm · md · lg). Inside Field, SearchField inherits the field size when size is omitted.

PropDefaultTypeDescription
value—stringControlled query string.
defaultValue—stringUncontrolled initial query.
onValueChange—(value: string) => voidEvent handler when query changes.
appearance"filled""filled" | "plain"Visual style: filled (standalone) or plain (for composed surfaces).
size"md""sm" | "md" | "lg"Control size — same tiers as Input. Inherits from Field when omitted; plain only takes the size's typography and icon sizes.
disabledfalsebooleanDisables interaction.
aria-label—stringAccessible name for the search input.

Search icon slot (defaults to search glyph).

Input element.

Clear button (defaults to dismiss glyph).