Componentform0.86 KB gzipZero dependencies
Search Bar
Dashed search field with shortcut keycap and clear action.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add search-barOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { SearchBar } from "@/components/ui/search-bar"; <SearchBar placeholder="Search tickets..." shortcut="⌘K" />Source code
search-bar.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxsearch-bar.tsx106 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface SearchBarProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue"> { value?: string; defaultValue?: string; onValueChange?: (val: string) => void; onSearch?: (val: string) => void; shortcut?: string; className?: string;} export function SearchBar({ value: controlledValue, defaultValue = "", onValueChange,Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { SearchBar } from "@/components/ui/search-bar"; <SearchBar />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "") |
| onValueChange | (val: string) => void | Callback invoked on value change. |
| onSearch | (val: string) => void | Callback invoked on search. |
| shortcut | string | Configures shortcut. (Default: "⌘K") |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |