Ballmac UI home

Search 1: results page

A search results page: a large search box, the type of result as a filter with live counts, a date filter and sort, results with a trail and highlighted words, and a no-results page that suggests what to try.

State

The normal view. Pick a state to see what the block shows while it loads, is empty or fails.

Open in v0 (opens in a new tab)

Installation

$ pnpm dlx shadcn@latest add @ballmac/search-1

Usage

Example: search-1-demo.tsx
"use client"

import { Search1 } from "@/components/ballmac/blocks/search-1/search-1"

export default function Search1Demo() {
  return <Search1 timing="0.14 s" onOpen={() => {}} />
}

States

Pass state and the block does the rest: skeletons that match its layout, a clear empty message, an error you can retry, and announcements for screen readers.

  • Loading

    Skeleton filters and results under the real search box, announced as searching; the box is disabled.

    state="loading"
  • No results

    A page that says what was searched, suggests a spelling (didYouMean), lists what to try and offers to clear filters; emptyState sets the copy.

    state="empty" (or a search that matches nothing)
  • Could not search

    An alert saying the search was kept, with Try again (onRetry).

    state="error"

Quality scorecard

8/8

Every applicable check passes

Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 5 examples.

How we measure
  • Passed: Accessibility scan

    No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).

  • Passed: Small screens

    No sideways scrolling at 360, 390 or 1280 px wide.

  • Passed: Reduced motion

    Every endless animation stops when the visitor asks for less motion.

  • Passed: Right to left

    Mirrors correctly in Arabic, Hebrew, Persian and Urdu layouts (8% of elements off the mirror, limit 15%).

  • Passed: Clean console

    No console errors or React hydration errors while loading.

  • Passed: Keyboard

    26 tab stops, each showing a visible change when it takes focus. 3 documented keys.

  • Passed: Loading, empty and error

    Ships loading, empty, error states, each with an example.

  • Passed: Automated tests

    Covered by search-1.test.tsx.

  • For information: Footprint

    6.8 KB of source (gzip) in 1 file. Installs lucide-react.

Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.

Dependencies

Use with AI

A site or workspace search results page. <Search1 results={[{ id, kind: 'doc' | 'person' | 'project' | 'file', title, snippet, path: ['Docs', 'API'], updated, ageDays, author, href }]} defaultQuery onQueryChange onOpen timing pageSize didYouMean />. It filters and ranks the results you pass; for server search, pass the results your API returned for onQueryChange and keep the filters here. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Search 1: results page (@ballmac/search-1) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • The page behind a site, docs or workspace search
  • Mixed results of several types that people narrow by type and date

Not for

  • A quick-jump palette (use command or spotlight-search)
  • Searching inside one list (use search-field with the list)
  • A help center home (use help-1)

Registry JSON: https://ui.ballmac.com/r/search-1.json

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.