Hreflang Check

Hreflang Check is a copy-paste React component that stops helps catch hreflang tags google would ignore 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/hreflang-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 hreflang tags Google would ignore

Was this component page useful?

How do I install Hreflang Check?

pnpm dlx shadcn@latest add @bollard/hreflang-check

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

How do I use Hreflang Check in React?

hreflang-check-usage.tsx
import { HreflangCheck } from "@/components/ui/hreflang-check"

return <HreflangCheck defaultValue={pricingPages} rows={7} />

What input mistakes does Hreflang Check catch?

  • Missing or near-miss return links between versions
  • Codes Google doesn't support: en-UK, es-419, region-only codes
  • Relative or protocol-relative URLs
  • Missing self-reference or x-default
  • A canonical pointing at another language's page

What props does Hreflang Check accept?

HreflangCheck props
PropTypeDefault
value

Controlled text: <link> tags (HTML head or sitemap xhtml:link), grouped under a URL line or <loc> per page.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the new text on every edit or fix.

(value: string) => void—
pageUrl

URL of the page when only one page's tags are pasted without a URL line.

string—
label

Visible label; shorthand for `messages.label`.

string—
messages

Every visible string. `{detail}`, `{to}`, `{fix}`, `{url}`, `{count}` are filled in.

Partial<HreflangCheckMessages>—

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

How is Hreflang Check accessible?

  • Text area has a label, aria-invalid when errors exist, and is described by the hint and status
  • Status uses role=status; icons are aria-hidden
  • The link grid is a table with row and column headers and a text description in each cell
  • Focus returns to a nearby button 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?

  • Checks only what you paste; it does not crawl live pages or HTTP Link headers
  • Follows Google's documented rules; other search engines may differ
  • Can't tell whether page content actually matches the declared language

What validation rules apply to Hreflang Check?

Rules last verified:

Informational; check the official source. Confirmed: return links, self-reference, fully-qualified URLs, ISO 639-1 + ISO 3166-1 alpha-2 (es-419 unsupported, UK not a valid region), optional ISO 15924 script, x-default. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Hreflang Check stop?

Helps catch hreflang tags Google would ignore

Also known as

hreflang · seo · i18n · sitemap · canonical · multilingual · search console · x-default

Field type

What dependencies does Hreflang Check require?

Hreflang Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameHreflang Check
Registry identifier@bollard/hreflang-check
Install commandnpx shadcn@latest add @bollard/hreflang-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 Hreflang Check

What form validation mistake does Hreflang Check catch?

Hreflang Check prevents helps catch hreflang tags Google would ignore. Checks hreflang tags or a sitemap against Google's rules, so missing return links or bad codes don't get the whole set ignored. Catches: Missing or near-miss return links between versions, Codes Google doesn't support: en-UK, es-419, region-only codes, Relative or protocol-relative URLs, Missing self-reference or x-default, A canonical pointing at another language's page. Limitation: validate hreflang-check schemas on backend.

How do I install hreflang-check with shadcn?

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

What props customize Hreflang Check?

Hreflang Check accepts `value`, `defaultValue`, `onValueChange`, `pageUrl`, `label`. Configures hreflang, seo, i18n behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of hreflang-check?

Checks only what you paste; it does not crawl live pages or HTTP Link headers. Follows Google's documented rules; other search engines may differ. Can't tell whether page content actually matches the declared language Server requirement: backend verification for hreflang-check.

How does Hreflang Check meet accessibility guidelines?

Text area has a label, aria-invalid when errors exist, and is described by the hint and status. Status uses role=status; icons are aria-hidden. The link grid is a table with row and column headers and a text description in each cell. Focus returns to a nearby button after a fix. Minimizes errors: hreflang not working, missing return links.

Which components pair with Hreflang Check?