Search Input

A sophisticated search input with a built-in recommendation system and keyboard shortcut support (Ctrl+K). Features smooth Framer Motion animations for the result dropdown and responsive design for both desktop and mobile.

uiclass-variance-authorityframer-motionlucide-react

Installation

$npx futureuikit add search-input

Import

import { SearchInput } from "@/components/ui/search-input"
Layout Variant
Color Theme
Size
Spacing
Layout

Named Keys & Props

Pass these exact named keys as props on <SearchInput />. Click any color pill to copy the prop.

colorDefault is "default"(Black & White)
variantVisual style
"default""minimal""glass""pill"
shapeCorner shape
"default""square""rounded""sharp"
spacingInner spacing
"default""2x""4x""6x""8x"
sizeComponent size
"sm""md""lg""xl""2xl"

Usage Example

A basic implementation example to get you started.

Example Implementation
import { SearchInput } from"@/components/ui/search-input";

export default function Example() {
 return (
 <div className="w-full max-w-sm">
 <SearchInput placeholder="Search all components..."/>
 </div>
 );
}

Features

Key capabilities and highlights.

Key Capabilities
  • ◆Built-in recommendation engine that filters through the entire component library.
  • ◆Keyboard shortcut support: quickly focus the search with Cmd/Ctrl + K.
  • ◆Animated results dropdown with staggered entry effects.
  • ◆Full mobile responsiveness with optimized touch targets.
  • ◆Integrated with Lucide React for intuitive iconography.
  • ◆Highly customizable via props for different use cases.

Notes

Important implementation details to consider.

Implementation Details
  • ◆Install: Run'npx futureuikit add search-input'to install the input logic and Framer Motion dependencies.
  • ◆Import:'import { SearchInput } from "@/components/ui/search-input";'
  • ◆Shortcuts: The component automatically listens for global'Cmd+K'(Mac) or'Ctrl+K'(Windows) key events.
  • ◆Variants: Pass the'mobile'prop for optimized styling on smaller screens.
  • ◆Integration: Connect it to your data source by modifying the'handleSearch'function in the component source.