About The Project
Why it was built, and what it covers.
Credit to the Digital Government Authority (DGA) for its outstanding work in unifying Saudi Arabia's government websites and services under a single, coherent design language. The specifications published on Figma are clear and comprehensive; however, translating them into working code remains a challenge for most teams.
The DGA's official implementation is a React and Storybook component library that covers the core UI components. This project provides the same design system in plain HTML, CSS, and JavaScript, and includes all components, a layout system, page templates, documentation, and a complete development environment. No framework is required.
This is an independent community implementation, not affiliated with, endorsed by, or maintained by the Digital Government Authority (DGA) or the Government of Saudi Arabia.
Compliance Ready
Official DGA page templates, converted into live, working code and ready for deployment.
Every component adheres to the official design tokens, typography, spacing, and interaction patterns. The templates below cover the most common government service screens, ready to copy, populate with your content, and publish.
Real-World Examples
5 composed pages showing NDS components working together in real government service contexts.
Components (74)
Each with markup, styling, and JavaScript behavior. All built from scratch.
Accordion
Expandable content panels with nested group support
Alert
Contextual messages for status, warnings, and notifications
Avatar
Profile images, initials, and group stacks
Breadcrumb
Hierarchical path showing the current page location
Buttons
Interactive actions with multiple variants, sizes, and states
Cards
Versatile content containers for articles, profiles, and actions
Chips
Compact labels for tags, filters, and selections
Code
Formatted code blocks with syntax highlighting and copy
Cooldown Button
Click-disabled countdown button for resend, retry, and rate-limited actions
Dark Mode
Full-page light and dark theme toggle with localStorage persistence and circular reveal animation
Definition List
Structured key-value pairs in grid or list layouts
Drawer
Collapsible navigation lists with accordion groups
Dropmenu
Toggle-activated overlay for actions and navigation
Empty
Parent-adaptive placeholder for containers with no content
Featured Icons
Decorative icon containers with shape and color options
Feedback Icons
Semantic status icons for success, error, and info
Hero
Full-width page banners with slider and call-to-action
Link
Inline navigation with color variants and automatic external-link detection
Loading
Spinners and skeleton placeholders for loading states
Metric
Dashboard tile pairing a key statistic with an inline sparkline
Modal
Focused dialog overlays for confirmations and forms
Pagination
Page-by-page navigation for large data sets
Persona
Identity block with avatar, name, role, and optional action row
Progress
Visual indicators for task completion and loading
Quote
Semantic quotation block with optional title and author attribution
Rating
Star-based display and input for user ratings
Scroll More
Overflow wrapper with edge mask-fade and sticky show-more button
Stepper
Sequential step indicators for multi-stage workflows
Swiper
Touch-enabled carousel for images and content slides
Tabs
Switchable content panels with horizontal tab navigation
Tags
Small labels for categorization and metadata
TOC
Auto-populated in-page table of contents with active-section tracking
Tooltip
Click-activated balloon for contextual help next to a term or field
Text Inputs
Single-line fields with labels, icons, and validation
Selects
Native dropdown menus for choosing from a list
Textareas
Resizable multi-line text fields
Number Input
Numeric field with increment and decrement controls, min/max, and step
Checkbox
Multi-select toggles for options and preferences
Radio
Single-choice selection within a group
Switch
Binary on/off toggles for settings and preferences
OTP Input
Segmented one-time password fields with auto-advance
File Upload
Drag-and-drop file input with preview and validation
Autocomplete
Type-ahead search with filtered suggestions
Multiselect
Multi-option select with grouped checkboxes, draft/apply commit, and removable chips
Filter
Applied filters with search, URL sync, and remote data
User Feedback
Satisfaction surveys and inline rating forms
Tables
Data grids with sorting, pagination, and expandable rows
Sort
DOM-reorder engine for lists, grids, and tables with type auto-detect and URL sync
Chart
Lightweight SVG charts: bar, line, pie, and donut
Section
Page content sections with head, body, and action areas
Grid
Responsive column system with flexible breakpoints
Block
Titled content grouping primitive for sub-sections inside a section body
Copy
One-click clipboard copy with checkmark feedback and screen reader announcement
Truncate Text
Line-clamped overflow with expand/collapse toggle
Divider
Horizontal or vertical rule with optional centered label
Expandable Content
Show more/less toggle for long content blocks
Flex
Quick alignment, direction, and wrapping with custom-property overrides
Saudi Cities
Bundled JSON dataset of 132 Saudi Arabian cities with bilingual names, drop-in for autocomplete and address flows
Numbers
Locale-aware thousand separators for any number on the page
Counter Animation
Scroll-triggered animated counters that count up to a target value
Currency
SAR and international currency symbols appended automatically via data attribute
Share
Social share dropmenu for X, LinkedIn, WhatsApp, and copy link
Top Bar
Government branding bar with date, weather, and dark mode toggle
Main Navigation
Primary site navigation with mega menu and mobile drawer
DGA Digital Stamp
Government authority verification panel
Side Menu
Collapsible nested sidebar navigation
Side Info
Companion column for service details, progress, and in-page navigation
Footer
Multi-column footer with light and green variants
Date Picker
Hijri/Gregorian calendar with dual date conversion
Speech Recognition
Voice input supporting Arabic and English
Weather Widget
Live weather display from GPS coordinates
Clock
Real-time clock with Hijri/Gregorian date
Cookie Consent
Privacy-compliant cookie management banner
Image Popup Viewer
Fullscreen image preview with zoom and navigation
Architecture & Performance
Built with a performance-first and compatibility approach.
No Bootstrap, Tailwind, jQuery, or framework runtime. The output is plain HTML, CSS, and JavaScript that works in any environment. No conflicts with existing scripts or stylesheets. Drop it into any project regardless of tech stack.
A single DOM sweep on page load detects which components are present and initializes them in priority order. The rest remain idle with zero runtime cost. Resources are only allocated for what the page actually uses.
Built with CSS Logical Properties from the start. Margins, paddings, borders, and positions adapt automatically. No separate RTL stylesheet. No overrides. Switch direction with a single HTML attribute.
Color tokens, semantic tokens, and component tokens, all defined as CSS custom properties. Each component exposes public properties for customization while keeping internal styles private, no overrides needed.
Critical styles load immediately for instant render. The rest is deferred and loads asynchronously without blocking the page. Styles are split between critical and non-critical at the build level.
The full component library in a single bundle for better compression, simpler deployment, and minimum requests. Components initialize as needed.
100% Google PageSpeed score. LCP, CLS, and INP all pass. Measured and optimized for real-world conditions. Tested across desktop and mobile on both fast and limited connections.
GPU-accelerated animations with optimized scheduling deliver smooth transitions even on lower-end devices, with a native application feel. Off-screen elements are not rendered until needed.
Development Environment
Everything needed to build, modify, and extend the system.
The project is built on Jekyll, a static site generator natively supported by GitHub Pages. It compiles templates, stylesheets, and data files into static HTML with no external toolchain.
Sass with a modular file structure. Each component has its own stylesheet. Variables, mixins, and design tokens are shared across all files. Jekyll compiles and minifies everything into a single CSS output.
Vanilla JavaScript with one file per component, controlled by a smart loader. Only active components initialize on each page. A Ruby processor bundles and minifies using Terser.
Jekyll's built-in template engine. Supports layouts, includes, partials, loops, conditions, and data binding. Pages are composed from reusable blocks with no duplicated markup.
YAML files act as a flat-file database for the project. Menus, navigation, hero content, and site configuration are stored as structured data and fed into templates at build time.
Custom Ruby scripts that extend Jekyll's build process. Handle JS bundling, HTML compression, baseurl resolution, and more. Each plugin is project-specific and fully editable.
Configured for Claude Code AI assistant with custom skills for documentation, content creation, code review, and component auditing. The codebase is structured for effective AI-assisted development.
Open Source
MIT licensed. Full source code included.
Download
Compiled HTML, CSS, and JavaScript ready to use. Source files included as reference.
Fork
Full source code with build system, templates, and tooling.
Contribute
Report issues, suggest improvements, or submit pull requests on GitHub.