Dirham and Riyal libraries, 65,000+ npm downloads
Two open-source libraries draw the new UAE Dirham and Saudi Riyal signs in apps, whatever fonts a device has.
The npm registry counts every download, including build servers, mirrors and bots, so these totals are not a count of people.
Outcomes
- dirham downloads, Feb to Sep 2026
- 61,673
- riyal downloads, Apr to Sep 2026
- 3,950
- dirham monthly downloads, Mar to Aug 2026
- 4,057 to 15,405
The problem
The Saudi and UAE central banks each released a new currency sign in 2025. Unicode, the standard that numbers every character, placed the Riyal at U+20C1 in version 17.0 and the Dirham at U+20C3 in version 18.0. Fonts lag behind each Unicode release, so neither sign rendered reliably when I built these packages in 2026. A price typed with the new sign could show an empty box instead.
Constraints
- Stay correct once system fonts catch up
- Show the sign before any font loads
- Fit any front end, even plain HTML
What I built
- I built both packages on the official Unicode numbers, not a made-up slot that only one font understands. Once system fonts draw the signs, an app can drop the web font and keep its formatted prices and SVG components unchanged.
- Each package also draws the sign as an SVG image that renders on the server with no font download. The dirham SVG offers six stroke weights, from regular to black, to match the text beside it.
- Both packages ship React and React Native components, plus Web Components for any framework or plain HTML. The riyal package adds native Vue 3 and Svelte 5 components.
- VAT helpers add or strip tax, at the UAE's 5% or Saudi Arabia's 15% by default. The riyal package also totals a cart, with discounts and shipping.
- Both packages also ship a Tailwind plugin, a Next.js font helper and a command-line tool that copies the sign.
- Each repository holds the package and its demo site. Each package carries 10 test files and a changelog.
Languages
- TypeScript
Stack
- TypeScript
- React and React Native
- Web Components
- Vue 3 and Svelte 5
- Tailwind CSS plugin
- Next.js next/font
- Turborepo and Changesets
- Vitest
Code and links
More case studies
Open source
15,246 businesses from 1,400 Google Maps requests
An open-source toolkit that crawls Google Maps into a business directory. No paid API call runs without an explicit yes.
Read case studyOpen source
An open-source method for governed agents
SpecForge blocks Claude Code from editing your code until you approve the spec and plan.
Read case study