Namesake Select

Namesake Select is a copy-paste React component that stops right name picked for wrong person 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/namesake-select
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 3 extra npm packages
  • A11y guidance in docs

StopsRight name picked for wrong person

Was this component page useful?

How do I install Namesake Select?

pnpm dlx shadcn@latest add @bollard/namesake-select

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

How do I use Namesake Select in React?

namesake-select-usage.tsx
import { NamesakeSelect, type NamesakeOption } from "@/components/ui/namesake-select"

<NamesakeSelect label="Attach lab report to patient" options={patients} value={patient} onValueChange={setPatient} />

What input mistakes does Namesake Select catch?

  • Two or more people with the same name, however it is typed
  • The details that tell namesakes apart, shown inline
  • Picking a shared name: re-entry of one identifier is required (default verify="reenter")
  • Identifier that matches a different namesake: one-tap switch
  • Identical records that can't be told apart

What props does Namesake Select accept?

NamesakeSelect props
PropTypeDefault
options* (required)

People to choose from, each with a name and identifying details.

NamesakeOption[]—
value

Selected id (controlled). `null` means none.

string | null—
defaultValue

Initial selected id when uncontrolled.

string | nullnull
onValueChange

Fires with the chosen id, or `null` when the text is edited away. With `verify="reenter"`, a name someone else shares only becomes the value once confirmed.

(id: string | null) => void—
verify

`reenter` (default) asks for one identifier when a picked name is shared; `readback` only shows the identifiers. Re-entry cut wrong-patient orders about twice as much as a confirm alert did (Adelman et al., JAMIA 2013).

"reenter" | "readback""reenter"
label* (required)

Visible label of the field.

string—
identifiers

How many identifying details to read back once chosen. Two, as patient-safety practice asks.

number2
messages

Override any visible string.

Partial<typeof NAMESAKE_SELECT_MESSAGES>—

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

How is Namesake Select accessible?

  • Combobox with a visible label, aria-expanded and arrow-key/Enter navigation
  • Focus moves into the verification card and back to the input
  • Animations are skipped under reduced motion

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

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Re-check the selected record ID on the server before acting on it (orders, payments, records).

  • Only as good as the identifiers you pass (date of birth, city, phone)
  • Name matching ignores case, accents, punctuation and word order, but not nicknames or transliteration variants
  • Re-entry adds a step for every shared name, by design

What expensive mistakes does Namesake Select stop?

Right name picked for wrong person

Also known as

namesake · same name · patient select · customer picker · contact picker · people search · duplicate records · crm

Field type

What dependencies does Namesake Select require?

Namesake Select facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameNamesake Select
Registry identifier@bollard/namesake-select
Install commandnpx shadcn@latest add @bollard/namesake-select
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)
Dependencies@floating-ui/react, lucide-react, motion
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 Namesake Select

What form validation mistake does Namesake Select catch?

Namesake Select prevents right name picked for wrong person. Flags options that share a name and asks for one identifier before a shared name is picked, so the right name doesn't go to the wrong person. Catches: Two or more people with the same name, however it is typed, The details that tell namesakes apart, shown inline, Picking a shared name: re-entry of one identifier is required (default verify="reenter"), Identifier that matches a different namesake: one-tap switch, Identical records that can't be told apart. Limitation: validate namesake-select schemas on backend.

How do I install namesake-select with shadcn?

Run `npx shadcn@latest add @bollard/namesake-select`. Sources added: registry/default/namesake-select/namesake-select.tsx, registry/default/namesake-select/namesake.ts. Package requirements: @floating-ui/react, lucide-react, motion.

What props customize Namesake Select?

Namesake Select accepts `options`, `value`, `defaultValue`, `onValueChange`, `verify`. Configures namesake, same name, patient select behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of namesake-select?

Only as good as the identifiers you pass (date of birth, city, phone). Name matching ignores case, accents, punctuation and word order, but not nicknames or transliteration variants. Re-entry adds a step for every shared name, by design Server requirement: Re-check the selected record ID on the server before acting on it (orders, payments, records).

How does Namesake Select meet accessibility guidelines?

Combobox with a visible label, aria-expanded and arrow-key/Enter navigation. Focus moves into the verification card and back to the input. Animations are skipped under reduced motion. Minimizes errors: same name wrong patient, duplicate names select.

Which components pair with Namesake Select?