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
  • Task List

    Task List

    8
  • Uai Blocks Community Feed

    Uai Blocks Community Feed

    5
  • Reaction Bar

    Reaction Bar

    3
  • Cart Item

    Cart Item

  • Quantity Picker

    Quantity Picker

  • Comment

    Comment

  • Metric Card

    Metric Card

More in Forms

View all
  • Form

    Form

    7
  • Login 2

    Login 2

    16
  • Contact Form

    Contact Form

    33
  • Contact Card

    Contact Card

    1.1K
  • Book A Demo 1

    Book A Demo 1

    95
  • Premium Auth

    Premium Auth

    614
  • Onboarding Stepper

    Onboarding Stepper

    13
  • Authentication Card

    Authentication Card

    52