Alt Text Check

Alt Text Check is a copy-paste React component that stops unusable alt text gets posted 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/alt-text-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

StopsUnusable alt text gets posted

Was this component page useful?

How do I install Alt Text Check?

pnpm dlx shadcn@latest add @bollard/alt-text-check

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

How do I use Alt Text Check in React?

alt-text-check-usage.tsx
import { AltTextCheck, type AltImage } from "@/components/ui/alt-text-check"

<AltTextCheck defaultValue={images} onPost={() => setPosted(true)} />

What input mistakes does Alt Text Check catch?

  • Missing alt text
  • Filenames, camera names and hashes used as alt text
  • "Image of" / "picture of" redundancy
  • Alt text that repeats the caption, or runs past the length limit
  • Screenshots and images with text whose alt text may not include that text

What props does Alt Text Check accept?

AltTextCheck props
PropTypeDefault
value

Controlled images.

AltImage[]—
defaultValue

Initial images when uncontrolled.

AltImage[][]
onValueChange

Called with the updated images whenever alt text or the decorative flag changes.

(images: AltImage[]) => void—
onPost

Called when posting. With problems left, the first click jumps to them and asks again.

(images: AltImage[]) => void—
maxLength

Alt text longer than this is flagged.

number125
chipLabels

Status chip labels, by status.

Partial<Record<AltStatus, string>>—
summaryText

`{count}` (images with problems) and `{total}` are filled in. Without `{total}`, `{count}` reads "3 of 4".

string"{count} of {total} need better alt text"
messages

Reasons shown under each flagged image.

Partial<typeof ALT_TEXT_MESSAGES>—
allGoodText

Summary shown when every image passes.

string"Every image is described"
altLabel

Label for each alt text field.

string"Alt text"
decorativeLabel

Label for the decorative toggle.

string"Decorative"
textHint

Reminder shown for images that contain text.

string"Has text in it? Include the words that matter."
decorativePlaceholder

Placeholder shown in the field when the image is marked decorative.

string"Skipped by screen readers (alt=\"\")"
fixLabel

Text for the one-tap fix button.

string"Remove “Image of”"
clearLabel

Text for the button that clears a filename used as alt text.

string"Clear it"
postLabel

Post button text.

string"Post"
postAnywayLabel

Post button text after problems were shown once.

string"Post anyway"

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

How is Alt Text Check accessible?

  • Each alt field has a <label> and aria-describedby pointing at its hint; aria-invalid when there is a problem
  • Per-image hints and the summary are aria-live="polite"
  • Post moves focus to the first field with a problem
  • Status uses text and icons, not colour alone

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

What are the limitations and server boundaries?

  • It checks wording patterns, not whether the description is accurate
  • Whether an image contains text comes from your data (OCR or uploader); screenshots are assumed to
  • Posting with problems is still possible after the first press

What expensive mistakes does Alt Text Check stop?

Unusable alt text gets posted

Also known as

alt text · accessibility · a11y · image upload · screen reader · wcag · post composer · cms

Field type

What dependencies does Alt Text Check require?

Alt Text Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameAlt Text Check
Registry identifier@bollard/alt-text-check
Install commandnpx shadcn@latest add @bollard/alt-text-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 Alt Text Check

What form validation mistake does Alt Text Check catch?

Alt Text Check prevents unusable alt text gets posted. Checks each image's alt text before posting, so filenames, "image of" and empty alt text don't reach screen-reader users. Catches: Missing alt text, Filenames, camera names and hashes used as alt text, "Image of" / "picture of" redundancy, Alt text that repeats the caption, or runs past the length limit, Screenshots and images with text whose alt text may not include that text. Limitation: validate alt-text-check schemas on backend.

How do I install alt-text-check with shadcn?

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

What props customize Alt Text Check?

Alt Text Check accepts `value`, `defaultValue`, `onValueChange`, `onPost`, `maxLength`. Configures alt text, accessibility, a11y behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of alt-text-check?

It checks wording patterns, not whether the description is accurate. Whether an image contains text comes from your data (OCR or uploader); screenshots are assumed to. Posting with problems is still possible after the first press Server requirement: backend verification for alt-text-check.

How does Alt Text Check meet accessibility guidelines?

Each alt field has a <label> and aria-describedby pointing at its hint; aria-invalid when there is a problem. Per-image hints and the summary are aria-live="polite". Post moves focus to the first field with a problem. Status uses text and icons, not colour alone. Minimizes errors: missing alt text, img_2041.jpg as alt.

Which components pair with Alt Text Check?