Componentform0.86 KB gzipZero dependencies

Search Bar

Dashed search field with shortcut keycap and clear action.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add search-bar

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { SearchBar } from "@/components/ui/search-bar"; <SearchBar placeholder="Search tickets..." shortcut="⌘K" />

Source code

search-bar.tsx + 1 helper

Zero 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 />
PropTypeDescription
valuestringControlled value.
defaultValuestringInitial value when uncontrolled. (Default: "")
onValueChange(val: string) => voidCallback invoked on value change.
onSearch(val: string) => voidCallback invoked on search.
shortcutstringConfigures shortcut. (Default: "⌘K")
classNamestringOptional Tailwind or custom CSS classes merged with component styles.