Search Input

Search Input: Search field with leading icon and clear button. Controlled or uncontrolled value, hidden native cancel, and keyboard-friendly reset. Free MIT React & Next.js source with Motion and Tailwind CSS, live preview, CLI install and docs.

Install Search Input

npx motion-ui-skill add search-input

Components install as source into your project. The interactive page also includes preview, code, documentation and install tabs.

Dependencies

  • clsx
  • lucide-react
  • react
  • tailwind-merge

Source files

Search Input

Search field with leading icon and clear button. Controlled or uncontrolled value, hidden native cancel, and keyboard-friendly reset.

Install

npx motion-ui-skill add search-input

Dependencies

  • clsx
  • lucide-react
  • react
  • tailwind-merge

Usage

"use client";

import { SearchInput } from "@/components/inputs/search-input";

export function SearchInputDemo() {
  return (
    <div className="flex items-center justify-center p-6">
      <SearchInput />
    </div>
  );
}

API Reference

SearchInput

Prop Type Default Required Description
className string — No Additional CSS classes

Browse this category