Boolean Query Input

Boolean Query Input is a copy-paste React component that stops boolean search returns the wrong people before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/boolean-query-input
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsBoolean search returns the wrong people

Was this component page useful?

How do I install Boolean Query Input?

pnpm dlx shadcn@latest add @bollard/boolean-query-input

The files land in your project. They're yours to edit.

How do I use Boolean Query Input in React?

boolean-query-input-usage.tsx
import { BooleanQueryInput } from "@/components/ui/boolean-query-input"

<BooleanQueryInput label="Search candidates" value={query} onValueChange={setQuery} placeholder='e.g. ("product manager" OR PM) AND fintech' />

What input mistakes does Boolean Query Input catch?

  • Mixed AND/OR without brackets, read back with the engine's implied grouping
  • Unclosed quotes or brackets, and curly quotes
  • Square brackets used instead of parentheses
  • Lowercase and/or that engines search as words
  • Dangling operators at the start or end

What props does Boolean Query Input accept?

BooleanQueryInput props
PropTypeDefault
label

Visible label.

string"Search"
value

Controlled query.

string—
defaultValue

Initial query when uncontrolled.

string""
onValueChange

Called with the query on every change and fix.

(value: string) => void—
precedence

How your search engine groups AND and OR without brackets. LinkedIn and most engines apply AND first.

QueryPrecedence"and-first"
onIssuesChange

Called with the current issues once typing pauses, so a form can hold the search until they're fixed.

(issues: QueryIssue[]) => void—
delay

Pause in ms before warnings appear while typing. Leaving the field shows them at once.

number600
messages

Override any message or label.

Partial<typeof BOOLEAN_QUERY_MESSAGES>—

* required. Also accepts the native props of <input> (className, aria-*, data-*…), passed through to it.

How is Boolean Query Input accessible?

  • Visible <label>; the input is described by the readback and status
  • Status and issues are aria-live="polite"
  • Fix buttons have aria-labels with the exact query they apply
  • Dismiss button has an aria-label

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Assumes AND binds first unless you set precedence; engines differ
  • Does not know engine-specific syntax beyond AND, OR, NOT, quotes and brackets

What expensive mistakes does Boolean Query Input stop?

Boolean search returns the wrong people

Also known as

boolean search · search query · and or not · recruiter search · advanced search · naukri · linkedin · sourcing

Field type

What dependencies does Boolean Query Input require?

Boolean Query Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameBoolean Query Input
Registry identifier@bollard/boolean-query-input
Install commandnpx shadcn@latest add @bollard/boolean-query-input
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Boolean Query Input

What form validation mistake does Boolean Query Input catch?

Boolean Query Input prevents boolean search returns the wrong people. Shows how a search engine will group AND and OR in a boolean query, so a search doesn't quietly return the wrong people. Catches: Mixed AND/OR without brackets, read back with the engine's implied grouping, Unclosed quotes or brackets, and curly quotes, Square brackets used instead of parentheses, Lowercase and/or that engines search as words, Dangling operators at the start or end. Limitation: validate boolean-query-input schemas on backend.

How do I install boolean-query-input with shadcn?

Run `npx shadcn@latest add @bollard/boolean-query-input`. Sources added: registry/default/boolean-query-input/boolean-query-input.tsx, registry/default/boolean-query-input/boolean-query.ts. Package requirements: lucide-react.

What props customize Boolean Query Input?

Boolean Query Input accepts `label`, `value`, `defaultValue`, `onValueChange`, `precedence`. Configures boolean search, search query, and or not behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of boolean-query-input?

Assumes AND binds first unless you set precedence; engines differ. Does not know engine-specific syntax beyond AND, OR, NOT, quotes and brackets Server requirement: backend verification for boolean-query-input.

How does Boolean Query Input meet accessibility guidelines?

Visible <label>; the input is described by the readback and status. Status and issues are aria-live="polite". Fix buttons have aria-labels with the exact query they apply. Dismiss button has an aria-label. Minimizes errors: boolean search and or grouping, unclosed quote search.

Which components pair with Boolean Query Input?