Public · UX library

Lingua Priority

A tiny zero-dependency package that fixes language dropdown ordering by combining browser preferences, global speaker reach, internet usage, and predictable alphabetical fallback.

Public repo Zero dependencies 48 tests passed

Problem

Most language selectors sort alphabetically, which buries high-usage languages such as Spanish under dozens of low-relevance choices. It is a small UX mistake, but it shows how often product defaults ignore real user behavior.

What I Built

Lingua Priority returns a suggested list and an alphabetical rest list. Browser languages come first when available, then top global languages backfill the list. The rest stays predictable for users who need the full catalog.

UX judgment Prioritizes likely choices while preserving full-language access.
API shape suggest(), getTop(), sortBy(), preset(), find(), and codes().
Package quality ESM, CJS, type declarations, zero runtime dependencies, SSR-safe browser detection.
Lingua Priority proof diagram showing suggested languages, all-language fallback, API shape, package proof, and hiring signal.
Public-safe dropdown visual. It turns a small library into a legible proof of taste, defaults, package discipline, and test coverage.
Package-driven Lingua Priority dropdown demo rendered from built package output with suggested languages and alphabetical fallback.
Package-driven dropdown proof captured from the built dist/index.js output. The screen shows suggest(8) rendering suggested languages first, then the alphabetical fallback list.

Technical Decisions

  • Return simple arrays instead of prescribing a framework-specific component.
  • Keep browser detection SSR-safe so Next.js and Remix users avoid hydration problems.
  • Ship ESM, CJS, and type declarations while preserving zero runtime dependencies.
  • Cover data integrity, sorting, presets, lookup, browser detection, and suggestion behavior with tests.

What This Proves

Lingua Priority is small, but it is useful hiring evidence: taste in defaults, respect for user context, package discipline, and the ability to turn a sharp UX observation into an auditable utility.