Search Field

Command-bar-style search input with optional ⌘-K shortcut chip. Five states — idle, hover, focus, text-inactive (placeholder), text-active (typed). Controlled or uncontrolled.

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/andromeda-search-field

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

PropTypeDefaultDescription
placeholderstring'Search anything'Text shown when empty. Defaults to "Search anything".
shortcutstring|null'⌘ K'Keyboard shortcut chip. Pass null to hide. Defaults to "⌘ K".
iconReact.ComponentType<{ size?: number, weight?: string, color?: string, style?: React.CSSProperties }>MagnifyingGlassPhosphor-style leading icon. Defaults to MagnifyingGlass. Pass null to hide.
valuestring-Controlled value.
defaultValuestring-Uncontrolled initial value.
onValueChange(next: string) => void-Called when typed value changes.
ariaLabelstring-Accessible label for the input. Defaults to placeholder.
classNamestring-Class name forwarded to the outer wrapper.
styleReact.CSSProperties-Style merged into the outer wrapper (lets the parent set width).
disabledboolean-Disables the field: dims it to the disabled opacity, shows a not-allowed cursor, and disables the underlying input.

More Andromeda components