Components
Searchbar
macOS-style search field: capsule-rounded corners, search icon, clear button, five sizes, default/over-glass variants.
The Searchbar component is styled strictly in accordance with the Apple macOS 26 UI Kit Search Field. Unlike standard Text Fields, it features pill-rounded corners (rounded-full) across all sizes, a leading magnifying glass search icon, and a trailing clear button that dynamically appears when text is typed.
Installation
npx shadcn add https://acrylic-ui.vercel.app/r/searchbar.jsonUsage
import { Searchbar } from "@/components/acrylic/searchbar""use client"import * as React from "react"import { Searchbar } from "@/registry/acrylic/searchbar"export default function SearchbarDemo() { const [value, setValue] = React.useState("") return ( <div className="w-full max-w-sm px-4 py-8"> <Searchbar placeholder="Search files, components, settings..." value={value} onChange={(e) => setValue(e.target.value)} onClear={() => setValue("")} /> </div> )}Showcase
Explore all variants and sizes of the Searchbar component in both Light and Dark modes.
default Variant
mini
small
medium
large
xl
over-glass Variant
mini
small
medium
large
xl
"use client"import * as React from "react"import { Searchbar } from "@/registry/acrylic/searchbar"export default function SearchbarShowcase() { const [values, setValues] = React.useState<Record<string, string>>({ "default-medium": "Design Systems", "over-glass-medium": "Components", }) const handleChange = (id: string, val: string) => { setValues((prev) => ({ ...prev, [id]: val })) } const sizes = ["mini", "small", "medium", "large", "xl"] as const const variants = ["default", "over-glass"] as const return ( <div className="flex flex-col gap-8 w-full max-w-2xl px-4 py-8"> {variants.map((variant) => ( <div key={variant} className="flex flex-col gap-4"> <h3 className="text-sm font-semibold capitalize text-muted-foreground px-1"> {variant} Variant </h3> <div className="grid gap-4 bg-[var(--acr-surface)] border border-[var(--acr-border-soft)] p-6 rounded-2xl backdrop-blur-xl"> {sizes.map((size) => { const id = `${variant}-${size}` return ( <div key={size} className="grid grid-cols-[80px_1fr] items-center gap-4"> <span className="text-xs font-mono text-muted-foreground uppercase"> {size} </span> <Searchbar variant={variant} size={size} placeholder={`Search ${size}...`} value={values[id] || ""} onChange={(e) => handleChange(id, e.target.value)} onClear={() => handleChange(id, "")} /> </div> ) })} </div> </div> ))} </div> )}API Reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "over-glass" | "default" | The visual variant. default renders a solid background with a hairline border, while over-glass is borderless with a transparent background. |
size | "mini" | "small" | "medium" | "large" | "xl" | "medium" | The standard macOS control sizes, corresponding to heights 16px, 20px, 24px, 28px, and 36px. |
onClear | () => void | - | Callback triggered when the clear button is clicked. |
Notes
- Capsule Geometry: The Apple design kit enforces a strict
radius = height / 2(capsule) rule for all sizes of Search Fields. - Over-glass Variant: Used inside blurred chrome headers (like navigation toolbars). The background color resolves through scoped theme variables (
--acr-inputand--acr-input-border) to ensure proper translucency and color flipping under Light, Dark, and Acrylic modes. - Controlled vs Uncontrolled: The clear button works out-of-the-box for both controlled (
value+onChange) and uncontrolled (internal state) usage.