Back to Blog

dirham: The UAE Dirham Symbol (U+20C3) as Web Font, CSS Utility & React Component

ReactTypeScriptOpen SourceUnicodeCurrencyUAEnpmFont
UAE Dirham currency symbol U+20C3 rendered in a modern React application

The UAE Central Bank introduced an official currency symbol for the Dirham in 2025. The Unicode Technical Committee accepted it as U+20C3 and scheduled it for Unicode 18.0 in September 2026. The problem: most operating systems and fonts don't render it yet.

I built dirham, an npm package that makes U+20C3 usable in production today, with a clear migration path for when native OS support arrives.

Live Demo & Documentation

The Core Design Principle

Use the correct codepoint now. Drop the workaround later.

The package encodes the symbol as \u20C3 everywhere, in React components, CSS content values, and JS utilities. A custom web font provides the glyph today. When operating systems ship Unicode 18.0 support you remove the font import. Everything keeps working unchanged.

TodayAfter Unicode 18.0 (Sept 2026)
RenderingCustom web fontNative OS font
Your codeNo changes neededRemove dirham/css import

Installation

bash
pnpm add dirham

React: SVG Component

DirhamSymbol renders an inline SVG. SSR-compatible, no font loading required:

tsx
import { DirhamSymbol } from 'dirham/react'; function Price() { return <span>100 <DirhamSymbol size={16} /></span>; }

Weight Matching

tsx
<h1> <DirhamSymbol size="1em" weight="bold" /> Premium Plan </h1> <p style={{ fontWeight: 300 }}> Only <DirhamSymbol size="1em" weight="light" /> 9.99/month </p>

Weight values: thin · extralight · light · regular · medium · semibold · bold · extrabold · black

Props

PropTypeDefaultDescription
sizenumber / string24Width and height in px or CSS value
colorstringcurrentColorFill color
weightDirhamWeightregularStroke weight
aria-labelstringUAE DirhamAccessible label

React: Font Icon Component

Lighter markup, requires the CSS import:

tsx
import 'dirham/css'; import { DirhamIcon } from 'dirham/react'; function Price() { return <span>100 <DirhamIcon size={16} /></span>; }

CSS / HTML

typescript
import 'dirham/css';
html
<i class="dirham-symbol" aria-label="UAE Dirham"></i>

SCSS

scss
@use 'dirham/scss';

JavaScript Utilities

typescript
import { formatDirham, parseDirham, DIRHAM_UNICODE, DIRHAM_CURRENCY_CODE } from 'dirham'; formatDirham(1234.5); // '\u20C3 1,234.50' formatDirham(1234.5, { locale: 'ar-AE' }); // Arabic-Indic numerals formatDirham(100, { useCode: true }); // 'AED 100.00' parseDirham('\u20C3 1,234.50'); // 1234.5

Package Exports

ExportContents
dirhamCore utilities and constants
dirham/reactDirhamSymbol, DirhamIcon
dirham/cssCSS with @font-face
dirham/scssSCSS with @font-face
dirham/font/woff2Raw font file

Repository Structure

Turborepo monorepo with pnpm workspaces:

dirham/
├── apps/docs/          # Vite + React demo site
├── packages/
│   └── dirham-symbol/  # Published npm package
└── turbo.json

GitHub · npm · Live Demo

X / Twitter
LinkedIn
Facebook
WhatsApp
Telegram

About Pooya Golchian

Common questions about Pooya's work, AI services, and how to start a project together.

Get practical AI and engineering playbooks

Weekly field notes on private AI, automation, and high-performance Next.js builds. Each edition is concise, implementation-ready, and tested in production work.

Open full subscription page

Get the latest insights on AI and full-stack development.