Victor Mesquita

Search Field

Forms

About

A compound search input with a clear button, loading/empty/error status feedback, and a recent-searches list for forms and docs/command-style search bars.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Search Field to your project and fits it to your theme.

Code

How Search Field is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import {
  SearchField,
  SearchFieldControl,
  SearchFieldInput,
  SearchFieldClear,
  SearchFieldMessage,
  SearchFieldRecent,
  SearchFieldRecentItem,
} from "@/components/ui/search-field";

export default function SearchFieldDemo() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-2">
      <SearchField defaultValue="">
        <SearchFieldControl>
          <SearchFieldInput placeholder="Search docs..." />
          <SearchFieldClear />
        </SearchFieldControl>
        <SearchFieldRecent>
          <SearchFieldRecentItem value="billing">billing</SearchFieldRecentItem>
          <SearchFieldRecentItem value="webhooks">
            webhooks
          </SearchFieldRecentItem>
        </SearchFieldRecent>
        <SearchFieldMessage />
      </SearchField>
    </div>
  );
}

Dependencies

More by Victor Mesquita

View all
  • Data Table Toolbar

    Data Table Toolbar

    10
  • Uai Blocks Community Feed

    Uai Blocks Community Feed

    5
  • Cart Drawer

    Cart Drawer

  • App Sidebar

    App Sidebar

  • Filter Bar

    Filter Bar

  • Author Card

    Author Card

  • Contact Section

    Contact Section

  • Audit Log

    Audit Log

More in Forms

View all
  • Premium Auth

    Premium Auth

    593
  • Contact Form

    Contact Form

    28
  • Form

    Form

    4
  • Login 1

    Login 1

    70
  • Book A Demo 1

    Book A Demo 1

    94
  • Contact Card

    Contact Card

    1.1K
  • HeroUI Field Error

    HeroUI Field Error

    13
  • Form [react-aria-components]

    Form [react-aria-components]

    19