Installation
Install, wrap, and control every token.
Add three packages, import the styles once, and wrap your app in the provider. Then tune the whole system - palette, radius, typography, dark mode, direction - from one layer of CSS variables.
Requirements
dev-dga targets modern React and any bundler that can import a CSS file.
React 19
react and react-dom 19 are peer dependencies - the components use the React 19 runtime.
A CSS-aware bundler
Next.js, Vite, Remix - any setup where you can import a stylesheet. No CSS-in-JS runtime is involved.
TypeScript (optional)
Full types ship with the package. TypeScript is recommended but not required.
Install the packages
Three packages: the React components, the compiled CSS, and the design tokens. Install all three together.
The CSS package is a peer dependency of the React package - install it explicitly, not transitively.
Import the styles once
Import the stylesheet a single time at the root of your app (e.g. your root layout or entry file). It ships the reset, tokens, dark theme, and every component style.
Because the design system lives in @layer ddga-base / ddga-components, any unlayered rule of yours overrides it without !important.
Wrap your app in the provider
DgaProvider supplies direction, dark mode, the brand theme, and the portal root that overlays (modals, tooltips, toasts) render into. Mount it once, near the root, above everything that uses the library.
DgaProvider props
| Prop | Type | Default | What it controls |
|---|---|---|---|
dir | 'ltr' | 'rtl' | 'ltr' | Layout direction. Mirrors the whole tree via logical properties. |
mode | 'light' | 'dark' | 'light' | Color mode. Applies the dark token set on the provider root. |
theme | DgaTheme | saGreen | Brand theme - a palette name, a CSS color, or a full triplet. |
locale | string | - | BCP-47 locale forwarded to date- and number-aware components. |
as | ElementType | 'div' | The element the provider renders as (e.g. render on <body>). |
Theme the primary palette
The whole system re-tones from one value. Pass theme.primary in any of three forms - hover and active states are derived automatically with color-mix().
A built-in palette name
One of saGreen, info, success, warning, error, gray.
Any CSS color
A hex, rgb, or oklch string. Hover and active are derived for you.
An explicit triplet
Full control via { base, hover, active, foreground } when you need exact values.
Override any design token
Every color, radius, space, font, and shadow is a --ddga-* CSS variable declared in @layer ddga-base. Redeclare one anywhere - globally on :root, or scoped to a subtree - and the system follows. No build step, no Sass.
Token groups
| Group | Example variables | Controls |
|---|---|---|
| Color | --ddga-color-primary · --ddga-color-background · --ddga-text-primary · --ddga-color-border | Surfaces, text, borders, and semantic colors. |
| Radius | --ddga-radius-sm · --ddga-radius-md · --ddga-radius-lg · --ddga-radius-full | Corner rounding across every component. |
| Spacing | --ddga-space-1 … --ddga-space-16 | The spacing scale used for padding and gaps. |
| Typography | --ddga-font-ar · --ddga-font-mono · --ddga-font-size-* · --ddga-font-weight-* | Font families, sizes, and weights. |
| Shadow | --ddga-shadow-xs … --ddga-shadow-3xl | Elevation for cards, overlays, and popovers. |
| Charts | --ddga-chart-1 … --ddga-chart-6 | The categorical palette for data visualization. |
Scope overrides to a subtree by setting the variables on any wrapper element - the cascade does the rest, in light and dark.
Theme builder
A quick taste - tweak a few tokens and watch the preview re-tone. For complete control over all 188 tokens, open the full Theme Studio.
Account settings
Manage how your profile appears across every government service.
Your changes are saved automatically.
This is a preview. The Theme Studio gives you every --ddga-* token - all the color scales, radius, spacing, typography, and shadows - with live search and one-click export.
Open the full Theme StudioYour overrides
Paste these into a CSS file loaded after @dev-dga/css (e.g. your globals.css). They override the tokens every component reads - put them on :root for the whole app, or on any element to theme a subtree. Only the values you change appear here.
Dark mode
Dark mode is a curated token set, not a mechanical inversion. Drive it with the provider’s mode prop, or by toggling data-theme="dark" on a wrapper. Apply it before first paint (as this site does) to avoid a flash.
RTL & Arabic
Set dir="rtl" and the entire layout mirrors through logical properties - no per-component work. IBM Plex Sans Arabic covers Arabic and Latin from one family, so mixed content stays consistent.
Next steps
You’re set up. Here’s where to go from here: