Forms

Search Field

A text input designed for searching, often featuring built-in filtering, suggestions, and a clear button.

Basic

A search field is a box where you can type in keywords to search for something, like finding content on a website.

Loading...

Installation

npx shadcn@latest add @intentui/search-field

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

This component comes packed with several components to enhance functionality and provide a seamless experience.

Manual installation

npm i react-aria-components @intentui/icons

Anatomy

import { SearchField } from "@/components/ui/search-field"

<SearchField />

With label

You can add a label to the search field by using the label prop.

Loading...

Validation

Add a validation message to the search field by setting the validationMessage prop.

Loading...

Pending

Show a loading indicator to indicate that the search field is in a pending state by using the isPending prop.

Loading...

Description

You can add a description to the search field by using the description prop.

Loading...

Controlled

Like other fields, the search field can be controlled by managing its value through the value prop.

Loading...

Uncontrolled

Like other fields, the search field can be controlled by managing its value through the defaultValue prop.

Loading...

Readonly

When the search field is set to readonly, it cannot be edited.

Loading...

Disabled

Disable the search field by using the isDisabled prop.

Loading...
Unlock the full power of
Design Intent UI
Build modern web apps faster with 350+ blocks and polished templates crafted for professionals.
Explore