Change Highlight

Change Highlight is a copy-paste React component that stops price changed and nobody noticed 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/change-highlight
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

StopsPrice changed and nobody noticed

Was this component page useful?

How do I install Change Highlight?

pnpm dlx shadcn@latest add @bollard/change-highlight

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

How do I use Change Highlight in React?

change-highlight-usage.tsx
import { ChangeHighlight, type ChangeValue } from "@/components/ui/change-highlight"

<ChangeHighlight value={at(prices)} format={(v: ChangeValue) => inr.format(Number(v))} announce className="font-medium" />

What input mistakes does Change Highlight catch?

  • Silent live updates to numbers and statuses
  • Whether a move is good or bad, given the direction you mark as good
  • Changes since the last visit, when storageKey is set

What props does Change Highlight accept?

ChangeHighlight props
PropTypeDefault
value* (required)

The live value. Numbers get a direction; strings are shown as "changed".

ChangeValue—
format

Formats a value for display, e.g. as currency.

(value: ChangeValue) => stringString
goodDirection

Which way is good news: "up" (default, ▲ green), "down" (▼ green, e.g. latency) or "none".

"up" | "down" | "none""up"
holdMs

How long the arrow and tint stay after a change, in ms.

number3000
storageKey

Turns on "changed since your last visit": the last value you saw is kept in localStorage under this key.

string—
announce

Announce changes to screen readers (politely). Off by default so busy tables don't chatter.

booleanfalse
previousLabel

Templates: `{value}` is filled in.

string"Was {value}"
sinceVisitLabel

Text introducing changes since the last visit.

string"was {value} at your last visit"
dismissLabel

Accessible label for the dismiss button.

string"Mark as seen"
upLabel

Word for an increase.

string"up"
downLabel

Word for a decrease.

string"down"
changedLabel

Word for a non-numeric change.

string"changed"

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

How is Change Highlight accessible?

  • Flashes at most once a second and not at all with prefers-reduced-motion
  • Direction is given in words as well as ▲/▼ glyphs and colour
  • The changed value is focusable and described by a role="tooltip" showing the previous value
  • Optional aria-live="polite" announcement (announce prop); 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?

  • "Since your last visit" is stored in this browser's localStorage, so it doesn't follow the user across devices
  • Screen readers hear changes only when announce is on

What validation rules apply to Change Highlight?

Rules last verified:

Informational. One flash per second stays under the three-flashes-per-second limit. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Change Highlight stop?

Price changed and nobody noticed

Also known as

live updates · flash · price change · ticker · dashboard · realtime · stock price · crypto

Field type

What dependencies does Change Highlight require?

Change Highlight facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameChange Highlight
Registry identifier@bollard/change-highlight
Install commandnpx shadcn@latest add @bollard/change-highlight
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-11-15
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 Change Highlight

What form validation mistake does Change Highlight catch?

Change Highlight prevents price changed and nobody noticed. Flashes a live price, count or status once when it changes and keeps an up/down marker, so updates aren't missed. Catches: Silent live updates to numbers and statuses, Whether a move is good or bad, given the direction you mark as good, Changes since the last visit, when storageKey is set. Limitation: validate change-highlight schemas on backend.

How do I install change-highlight with shadcn?

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

What props customize Change Highlight?

Change Highlight accepts `value`, `format`, `goodDirection`, `holdMs`, `storageKey`. Configures live updates, flash, price change behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of change-highlight?

"Since your last visit" is stored in this browser's localStorage, so it doesn't follow the user across devices. Screen readers hear changes only when announce is on Server requirement: backend verification for change-highlight.

How does Change Highlight meet accessibility guidelines?

Flashes at most once a second and not at all with prefers-reduced-motion. Direction is given in words as well as ▲/▼ glyphs and colour. The changed value is focusable and described by a role="tooltip" showing the previous value. Optional aria-live="polite" announcement (announce prop); dismiss button has an aria-label. Minimizes errors: missed live price change, value updated silently.

Which components pair with Change Highlight?