dirham
v1.1.1
Published
UAE Dirham currency symbol (U+20C3). Web font, CSS, and React component
Maintainers
Readme
dirham
The UAE Dirham currency symbol () as a web font, CSS utility, and React component.
Built on U+20C3, the codepoint assigned to the UAE Dirham Sign in Unicode 18.0. Because the package renders the symbol through a custom web font today, it will continue working without any code changes when operating systems ship native Unicode 18.0 support in September 2026.
Installation
npm install dirham
# or
pnpm add dirham
# or
yarn add dirhamUsage
React — SVG component
Renders an inline SVG. No font loading required; works with SSR and React Server Components.
import { DirhamSymbol } from "dirham/react";
function Price() {
return (
<span>
100 <DirhamSymbol size={16} />
</span>
);
}Weight variants match the symbol stroke to surrounding text weight:
thin extralight light regular medium semibold bold extrabold black
<DirhamSymbol size="1em" weight="bold" />CSS / Web Font
import "dirham/css";<i class="dirham-symbol" aria-label="UAE Dirham"></i>SCSS
@use "dirham/scss";JavaScript utilities
import { formatDirham, parseDirham, DIRHAM_UNICODE } from "dirham";
formatDirham(1234.5); // "\u20C3 1,234.50"
formatDirham(1234.5, { locale: "ar-AE" }); // "١٬٢٣٤٫٥٠ \u20C3"
formatDirham(100, { useCode: true }); // "AED 100.00"
parseDirham("\u20C3 1,234.50"); // 1234.5Exports
| Import path | Description |
| -------------------------- | -------------------------------------------- |
| dirham | Core utilities and constants |
| dirham/react | DirhamSymbol (SVG) and DirhamIcon (font) |
| dirham/css | CSS with @font-face |
| dirham/scss | SCSS with @font-face |
| dirham/font/woff2 | WOFF2 font file (default) |
| dirham/font/woff | WOFF font file |
| dirham/font/ttf | TTF font file |
| dirham/font/sans/woff2 | Sans-serif variant WOFF2 |
| dirham/font/serif/woff2 | Serif variant WOFF2 |
| dirham/font/mono/woff2 | Monospace variant WOFF2 |
| dirham/font/arabic/woff2 | Arabic variant WOFF2 |
Unicode
U+20C3 (UAE DIRHAM SIGN) was accepted by the Unicode Technical Committee on 2025-Jul-22 and is scheduled for Unicode 18.0 (September 2026). This package already uses that codepoint, so when system fonts gain native support the custom web font simply becomes unused — no API or template changes needed.
License
MIT. The Dirham symbol glyph is sourced from the Central Bank of UAE.
