Package Name Check

Package Name Check is a copy-paste React component that stops helps catch a typosquatted package before install 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/package-name-check
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

StopsHelps catch a typosquatted package before install

Was this component page useful?

How do I install Package Name Check?

pnpm dlx shadcn@latest add @bollard/package-name-check

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

How do I use Package Name Check in React?

package-name-check-usage.tsx
import { PackageNameCheck, type PackageInfo } from "@/components/ui/package-name-check"

return <PackageNameCheck defaultValue="npm install loadsh crossenv react@^19 express-session-redis-store" lookup={lookup} now={Date.UTC(2026, 9, 14)} />

What input mistakes does Package Name Check catch?

  • Lookalikes of popular packages, including capital I for l
  • Import names used as install names (sklearn, cv2, bs4, PIL)
  • Node or Python built-ins installed from the registry (fs, crypto, json)
  • Names npm or PyPI can't publish
  • Names that don't exist (AI-hallucinated) or appeared days ago, through your lookup

What props does Package Name Check accept?

PackageNameCheck props
PropTypeDefault
value

Controlled text: an install command, a requirements.txt or names one per line.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the text on every edit or fix.

(value: string) => void—
ecosystem

Registry for bare names. A command (npm i, pip install, uv add…) overrides it.

Ecosystem—
defaultEcosystem

Initial registry when uncontrolled.

Ecosystem"npm"
onEcosystemChange

Called when the user switches registry.

(ecosystem: Ecosystem) => void—
popular

Popular names to compare against per registry. Defaults to a curated list.

Partial<Record<Ecosystem, string[]>>—
lookup

Optional registry lookup (existence, downloads, first publish date). Rejections are caught.

(name: string, ecosystem: Ecosystem, signal: AbortSignal) => Promise<PackageInfo | null>—
now

Clock for "published N days ago", in ms. Defaults to the time the component mounted.

number—
onVerdictsChange

Called with every package's verdict whenever they change.

(verdicts: PackageVerdict[]) => void—
label

Visible label; shorthand for `messages.label`.

string—
messages

Every visible string. `{name}`, `{suggestion}`, `{ecosystem}` and the other placeholders are filled in.

Partial<PackageNameCheckMessages>—

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

How is Package Name Check accessible?

  • Visible label; ecosystem picker is a labelled radiogroup
  • Textarea is described by the status (role=status)
  • Focus returns to a nearby control after a fix

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: Pin dependencies with a lockfile and scan installs in CI; a client check is advisory.

  • The popular-package list is a curated sample; pass your own
  • Existence and age checks need your registry lookup
  • Doesn't scan package code or check maintainers

What validation rules apply to Package Name Check?

Rules last verified:

Informational. Confirmed npm's 214-character and no-uppercase rules and PyPI's normalization of runs of . - _ to a single -. The incident examples were not re-verified. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Package Name Check stop?

Helps catch a typosquatted package before install

Also known as

npm install · pip install · requirements.txt · package.json · typosquatting · supply chain · slopsquatting · dependency check

Field type

What dependencies does Package Name Check require?

Package Name Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component namePackage Name Check
Registry identifier@bollard/package-name-check
Install commandnpx shadcn@latest add @bollard/package-name-check
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 Package Name Check

What form validation mistake does Package Name Check catch?

Package Name Check prevents helps catch a typosquatted package before install. Reads an npm or pip install command package by package and flags typosquats, wrong import names and packages that don't exist yet. Catches: Lookalikes of popular packages, including capital I for l, Import names used as install names (sklearn, cv2, bs4, PIL), Node or Python built-ins installed from the registry (fs, crypto, json), Names npm or PyPI can't publish, Names that don't exist (AI-hallucinated) or appeared days ago, through your lookup. Limitation: validate package-name-check schemas on backend.

How do I install package-name-check with shadcn?

Run `npx shadcn@latest add @bollard/package-name-check`. Sources added: registry/default/package-name-check/package-name-check.tsx, registry/default/package-name-check/package-names.ts. Package requirements: lucide-react.

What props customize Package Name Check?

Package Name Check accepts `value`, `defaultValue`, `onValueChange`, `ecosystem`, `defaultEcosystem`. Configures npm install, pip install, requirements.txt behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of package-name-check?

The popular-package list is a curated sample; pass your own. Existence and age checks need your registry lookup. Doesn't scan package code or check maintainers Server requirement: Pin dependencies with a lockfile and scan installs in CI; a client check is advisory.

How does Package Name Check meet accessibility guidelines?

Visible label; ecosystem picker is a labelled radiogroup. Textarea is described by the status (role=status). Focus returns to a nearby control after a fix. Minimizes errors: npm typosquat package, ai hallucinated package name.

Which components pair with Package Name Check?