Abbr Hint

Turns jargon like TAT or SLA into a tappable, focusable hint so readers on touch screens and keyboards can see what it means.

StopsReaders guess at jargon like TAT

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/abbr-hint.json

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

Usage

abbr-hint-usage.tsx
import { AbbrGlossary, AbbrHint, GlossaryText, findUndefinedAbbreviations, type Glossary } from "@/components/ui/abbr-hint"

7.4 <AbbrHint side="top">kWh</AbbrHint>

What it catches

  • Abbreviations whose only explanation is a hover-only title attribute
  • First use of a term in a block of text, which can be spelled out inline
  • Plurals of known terms ("SLAs", "API's")
  • Abbreviations in the text that the glossary does not cover

Props

AbbrHint props
PropTypeDefault
children* (required)

The abbreviation as it appears in the text, e.g. "TAT".

string—
term

Glossary key when it differs from the text shown.

string—
expansion

What the abbreviation stands for. Taken from the glossary when omitted.

string—
definition

Plain-language meaning shown under the expansion.

string—
expand

Spell it out in the text as well ("turnaround time (TAT)"), for its first use on a page.

booleanfalse
glossary

Glossary to look the term up in. Defaults to the nearest AbbrGlossary.

Glossary—
side

Preferred side for the hint; it flips and slides to stay on screen.

"top" | "bottom""bottom"

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

Accessibility

  • Each term is a <button> with aria-expanded, reachable by Tab
  • The expansion is linked with aria-describedby, so screen readers hear it without opening the hint
  • Escape closes an open hint
  • Animation respects prefers-reduced-motion (motion's useReducedMotion)

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

Limitations

  • Matches whole words case-sensitively, so a differently cased spelling is not linked
  • Only knows the terms you put in the glossary; it does not guess expansions

What it stops

Readers guess at jargon like TAT

Also known as

abbreviation · acronym · glossary · tooltip · abbr · jargon · help text · definition

Field type

Dependencies

Pairs well with