About The Project
Why it was built, and what it covers.
The Digital Government Authority (DGA) sets one design system for Saudi Arabia's government websites and services. It publishes the specifications on Figma, and its official code is a React and Storybook library of the core UI components.
This project builds the DGA design system in plain HTML, CSS, and JavaScript. Plain web code works in any stack: static sites, server-rendered pages, or apps built with React or another framework. It brings no framework or dependencies of its own.
It goes beyond the components, with a layout system, DGA page templates, documentation, and a development environment. A team can build complete pages, not just single parts.
It is also built for AI-assisted development. NDS IQ, a versioned instruction system, gives AI coding agents a consistent way to build with NDS.
This is an independent community implementation of the National Design System (كود المنصات | نظام التصميم الموحد), not affiliated with, endorsed by, or maintained by the Digital Government Authority (DGA) or the Government of Saudi Arabia.
Who It's For
For teams and people who build, adapt, or learn government web development.
-
Government teams & agencies
Deliver DGA-aligned digital services on the stack you already run.
-
Freelancers
Build client sites with a reusable component library and ready page templates.
-
Students & fresh graduates
Learn core HTML, CSS, and plain JavaScript from a readable, production-grade codebase.
-
Teachers & trainers
Teach with real components, page templates, and patterns in web development courses, bootcamps, and workshops.
The default visual identity is exclusive to Saudi Arabia government entities. It covers design tokens, colors, logos, and the digital-stamp component. Non-government projects must replace these with their own identity before they go live.
DGA Page Templates
DGA-compliant page templates, delivered as working code.
Built around DGA design tokens, typography, spacing, and interaction patterns, these templates provide practical starting points for common government service screens. Use them as-is or customize them to fit your project.
Real-World Examples
15 full pages that show NDS components working together in government services.
Event Themes
Theme packs for national occasions. One script tag applies a theme to the whole site. Remove the tag to restore the default.
Library
Everything NDS ships, from design tokens to the JavaScript API. Filter by type, or search by name.
-
Accessibility
Site-wide panel for accessibility presets, typography tuning, and visual filters
-
Accordion
Expandable content panels with nested group support
-
Alert
Contextual messages for status, warnings, and notifications, in the page or as a toast
-
Audit
A check you run on a built page that lists NDS markup and CSS that fail with no error, and every name an NDS release changed
-
Autocomplete
Type-ahead search with filtered suggestions
-
Avatar
Profile images, initials, and group stacks
-
Block
Spacing unit for content and components, with an optional title
-
Breadcrumb
Hierarchical path showing the current page location
-
Buttons
Interactive actions with multiple variants, sizes, and states
-
Calendar
The events of one week, as seven day columns or a list of rows, or of one month under its days
-
Cards
Versatile content containers for articles, profiles, and actions
-
Chart
Lightweight SVG charts: bar, line, pie, and donut
-
Checkbox
Multi-select toggles for options and preferences
-
Chips
Compact labels for tags, filters, and selections
-
Clock
The current time, in the site's timezone, that changes on the minute
-
Code
Formatted code blocks with syntax highlighting and copy
-
Content Placeholder
Dashed stand-in marking a region a real component will replace
-
Content Switcher
Toggle between content sections within the same space on the screen
-
Cookies
A consent panel that stores the visitor's cookie choice by category
-
Cooldown Button
Click-disabled countdown button for resend, retry, and rate-limited actions
-
Copy
One-click clipboard copy with checkmark feedback and screen reader announcement
-
Countdown
Live count of the time left to a deadline or the end of a duration, as text or cards
-
Counter Animation
Scroll-triggered animated counters that count up to a target value
-
Currency
SAR and international currency symbols appended automatically via data attribute
-
Custom Select
Styled single-choice dropdown with custom option markup and a JS API, built on dropmenu
-
Date
Show, parse, print and convert dates in Gregorian and Hijri (Umm al-Qura), in the site's timezone and date format
-
Date Picker
Hijri/Gregorian calendar with dual date conversion
-
Date Tile
One date in a small box, with the weekday, the day number and the month
-
Definition List
Structured key-value pairs in grid or list layouts
-
DGA Digital Stamp
Government authority verification panel
-
Divider
Horizontal or vertical rule with optional centered label
-
Document Head
Critical CSS, deferred bundles, and the inline gate every page loads in its head
-
Drawer
Collapsible navigation lists with accordion groups
-
Dropmenu
Toggle-activated overlay for actions and navigation
-
Editor
Rich text field that submits clean NDS markup, converting Word, Google Docs, and web pastes and keeping pasted NDS components
-
Empty
Parent-adaptive placeholder for containers with no content
-
Expandable Content
Show more/less toggle for long content blocks
-
Export
Declarative CSV, Excel, and PDF downloads from any table, card list, or marked-up container
-
Featured Icons
Decorative icon containers with shape and color options
-
Feedback Icons
Semantic status icons for success, error, and info
-
File Upload
File field with a drop zone, file checks and upload status
-
Filter
Applied filters with search, URL sync, and remote data
-
Flex
Quick alignment, direction, and wrapping with custom-property overrides
-
Floating Action Button
FAB that pins to an edge of the viewport and stacks with others
-
Footer
Multi-column footer on the brand surface or light
-
Formatted Input
Phone number, national ID, IBAN, Saudi plate, VAT number and custom-format fields that keep the value in its shape
-
Grid
Responsive column system with flexible breakpoints
-
Header
The region at the top of the page where the top bar, digital stamp panel, and main navigation compose
-
Helper Classes
Single-purpose classes for your own markup: centering, spacing reset, direction isolation, brand text color, and notes
-
Helpers
The shared functions page code can call: states, ARIA, observers, timers, scroll, focus, text, and validation rules
-
Hero
Full-width page banners with slider and call-to-action
-
Hidden
CSS utilities that hide an element always, at chosen screen widths, or on screen only while screen readers still read it
-
Icons
Outline icons from the HugeIcons library, as a font with the full library for page content and a smaller built-in set for interface controls
-
Image
A photo cropped to fill a set shape, with a focal point and an optional overlay
-
Image Popup Viewer
Opens a thumbnail full screen, with zoom, pan and gallery navigation
-
Init
Starts every component at load, and the calls that tell them a container changed
-
Internationalization
The text NDS components write, in one file per language that the page loads and a site can change or extend
-
Link
Inline navigation with color variants and automatic external-link detection
-
List
A set of like items in a grid or in rows that fill, each a card that shares the list's look
-
Loading
Spinners and skeleton placeholders for loading states
-
Main Navigation
Primary navigation bar with branding, mega-menu dropdowns, search and language actions, and a mobile drawer
-
Meta
A line of short facts, each with an icon, such as a time, a place and a person
-
Metric
Dashboard tile pairing a key statistic with an inline sparkline
-
Migration
Every class, attribute, id, custom property, window setting, event and URL parameter that an NDS release renamed or removed, with what to write instead
-
Modal
Focused dialog overlays for confirmations and forms
-
Multiselect
Multi-option select over a native checkbox group: removable chips, JSON-populated options, staged or instant commit
-
Number Input
Numeric field with increment and decrement controls, min/max, and step
-
Numbers
Locale-aware thousand separators for any number on the page
-
OTP Input
Segmented one-time password fields with auto-advance
-
Page Layout
The body structure every page shares, with the classes that switch chrome shape
-
Pagination
Page-by-page navigation for large data sets
-
Panels
Content-agnostic surface that slides in from any edge of the viewport
-
Password
Password field with live strength rules and confirm-match checking
-
Persona
Identity block with avatar, name, role, and optional action row
-
Print
How a page prints, and a button that prints one part of the page alone
-
Progress
A circle or a bar that shows how much of a task is done
-
Prose
Default styling for classless flowing content from editors and CMSs
-
Quote
Semantic quotation block with optional title and author attribution
-
Radio
Single-choice selection within a group
-
Rating
Star-based display and input for user ratings
-
Request
Fetch wrapper with a timeout, a response size cap, and errors you can branch on
-
Scroll More
Overflow wrapper with edge mask-fade and sticky show-more button
-
Section
Page content sections with head, body, and action areas
-
Selection
Lets users pick items in any list, so one action can apply to all of them
-
Selects
Native dropdown menus for choosing from a list
-
Session Timeout
Warning before an idle session ends, with a countdown and a way to stay signed in
-
Share
Share buttons for X, LinkedIn, WhatsApp, other sites, the device's share sheet, and copy link, in a menu or a row
-
Side Info
Companion column for service details, progress, and in-page navigation
-
Side Menu
Collapsible nested sidebar navigation
-
Slider
Numeric range input with single-thumb and dual-thumb modes for picking a value or a min–max span
-
Sort
DOM-reorder engine for lists, grids, and tables with type auto-detect and URL sync
-
Status Section
Whole-page or inline outcome message with a status icon, a title, and one action
-
Stepper
Sequential step indicators for multi-stage workflows
-
Swiper
Touch-enabled carousel for images and content slides
-
Switch
Binary on/off toggles for settings and preferences
-
Tables
Data grids with sorting, pagination, and expandable rows
-
Tabs
Switchable content panels with horizontal tab navigation
-
Tag Input
Free-text tags committed as removable chips while typing, posted natively as an array
-
Tags
Small read-only labels for categories, status, and metadata
-
Text Inputs
Single-line fields with labels, icons, and validation
-
Textareas
Resizable multi-line text fields
-
Themes
Light and dark mode, plus brand theming: generate a full palette from OKLCH seed colours, or override the design tokens with a stylesheet theme
-
Time Picker
Time field with hour, minute and second pickers in a dropdown panel
-
Timeline
Dated events in order, such as a request's history, with the events done, the current one and the ones to come
-
TOC
Auto-populated in-page table of contents with active-section tracking
-
Tokens
The CSS custom properties behind NDS: the color palette, size scales, semantic meanings and component tokens, with a preview of each
-
Toolbar
Controls bar above a table, list, or grid: result counts and applied filters lead, export and actions trail
-
Tooltip
A balloon of contextual help next to a term, a field or a button, opened on click or on hover
-
Top Bar
The bar above the header: the digital stamp, strips that slide open below it, today's date, the time or the weather, and the dark mode button
-
Truncate Text
Clips long text to a set number of lines
-
User Feedback
Satisfaction surveys and inline rating forms
-
Voice Input
A microphone button that types what the user says into a text field, in the page language
-
Weather
The current weather for one or more places, from their coordinates
Architecture & Performance
Built for speed and wide browser support.
-
Zero Dependencies
No Bootstrap, Tailwind, jQuery, or framework runtime. The output is plain HTML, CSS, and JavaScript, so it fits into an existing stack without a framework.
-
Smart Component Loader
The loader scans the page once and starts the components it finds: critical ones first, the rest when the browser is idle. Extra bundles load only when their components are on the page, so each page runs only the JavaScript it uses.
-
RTL/LTR Native
Built with CSS Logical Properties from the start. Margins, padding, borders, and positioning adapt to direction without a separate RTL stylesheet or directional overrides. Switch between RTL and LTR with a single HTML attribute.
-
4-Tier Design Tokens
Palette, primitive, semantic, and component tokens are defined as CSS custom properties. Components expose public properties you can set, and keep their internals private.
-
Theming & Dark Mode
Light and dark modes are built in, with support for full re-branding. Generate a palette from a single OKLCH seed color, select a predefined theme, or load a stylesheet theme. Theme selection is controlled through a single HTML attribute and requires no rebuild.
-
~10 KB Critical CSS (gzipped)
The build splits the CSS in two. Critical styles load first; the rest load later without blocking the page.
-
5-Stage Reveal
The first paint arrives in five stages: inline critical skeleton → critical stylesheet → main stylesheet → main JavaScript → icons and font. Each stage shows only when it renders correctly, so there is no unstyled flash. Icons load last, so they do not delay the largest paint (LCP).
-
~64 KB Core JS (gzipped)
The full library is ~190 KB gzipped, but it is not loaded as a single bundle. A lean ~64 KB core loads on every page. Components that can wait, or that only some pages use, load only when their markup is present. A typical page runs a fraction of the library.
-
Web Vitals Compliant
A Google PageSpeed score of 100, with LCP, CLS, and INP passing in the measured test. Performance is tested on desktop and mobile, over fast and slow connections.
-
Animations
GPU-accelerated animations and scheduled rendering keep transitions smooth, even on low-end devices. Off-screen elements wait until they are needed.
Framework Support
NDS is plain HTML, CSS and JavaScript, so it is designed to work with any framework. No change to your stack is needed.
-
Tested Frameworks
NDS is browser-tested with React 18 and 19, Vue 3.4 and 3.5, Svelte 4 and 5, and Angular 17 and 19. The tests also cover server-rendered React and Vue pages, and htmx and Turbo swaps and morphs.
-
Mount and Destroy
Call
NDS.init.mount()when a framework renders a view, andNDS.init.destroy()before it removes one. Destroy clears the view's listeners, open menus and modal backdrops. -
HTML Swaps
Turbo, htmx and Livewire swaps use the same two calls: destroy the old content before the swap, and mount the new content after it.
-
Server Rendering and Hydration
NDS works with server-rendered apps in Next.js and Nuxt. Set
data-no-auto-initon<html>so NDS waits until hydration ends. -
Two-Way Binding
NDS fields fire native
inputandchangeevents when their value changes, so ReactonChange, Vuev-model, AngularngModeland Sveltebind:valuestay in sync. -
Framework-Native Translations
NDS changes only the text inside existing text nodes, so the framework's DOM stays as it rendered it.
data-i18nmarkers in JSX, Vue and Angular templates keep working after the framework renders again.
Development Environment
Everything needed to build, modify, and extend the system.
The project uses Jekyll, a static site generator supported by GitHub Pages. It compiles templates, stylesheets, and data files into static HTML with no external toolchain.
-
AI Integration
The NDS source is built to be worked on with AI coding agents. The repo includes its project rules and step-by-step workflows for common jobs, so an agent follows the same standards and runs the same checks as a developer.
-
Sass Architecture
Sass uses a modular file structure with one stylesheet per component. Shared variables, mixins, and design tokens are available across the system. Jekyll compiles and minifies the styles into the final CSS output.
-
Modular JavaScript
Vanilla JavaScript uses one source file per component and is controlled by the component loader. Only components present on a page initialize. A Ruby processor bundles and minifies with Terser into tiered outputs: a lean core plus deferred and page-specific bundles loaded on demand.
-
Liquid Templates
Jekyll's built-in template engine supports layouts, includes, partials, loops, conditions, and data binding. Pages are composed from reusable blocks rather than duplicated markup.
-
YAML-Driven Data
YAML files provide structured project data. Menus, navigation, hero content, and site configuration are stored as data and supplied to templates at build time.
-
Custom Plugins
Custom Ruby scripts extend Jekyll's build process for tasks such as JavaScript bundling, HTML compression, and base URL resolution. Each plugin is project-specific and editable.
Professional Support
Need help with NDS implementation, custom components, or a complete website or portal? Professional support and development services are available on request.