Search field

A recognizable search entry point with clear affordances.

npx shadcn@latest add @silicon-ui/search-field
fieldsearch
Loading…

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/search-field

Manually

  1. Install the dependencies.

    npm install lucide-react motion
  2. Copy these files into your project. Shared files are skipped if you already have them.

    • components/silicon-ui/search-field/search-field.tsx
    • components/silicon-ui/search-field/search-field.module.css
  3. Install the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

Source codetsx
import { SearchField } from "@/components/silicon-ui/search-field/search-field";

API reference

PropTypeDefault
label*string—
value*string—
onValueChange*(value: string) => void—

Also accepts the props of InputHTMLAttributes<HTMLInputElement>, except type.

Dependencies

npm
lucide-reactmotion
Registry
silicon-motion-tokens