Vanilla Design System

An open-source, vanilla implementation of Saudi Arabia's National Design System. Production-ready HTML, CSS, and JavaScript built from scratch with zero dependencies.

About The Project

Why it was built, and what it covers.

The Digital Government Authority (DGA) established a unified design language for Saudi Arabia's government websites and services. The specifications published on Figma provide a clear reference; the challenge is turning that specification into maintainable, production-ready code.

The DGA's official implementation is a React and Storybook component library covering the core UI components. This project provides the design system in plain HTML, CSS, and JavaScript, together with the component library, layout system, page templates, documentation, and development environment. No frontend framework is required.

The system is also built for AI-assisted development. Every release ships NDS IQ, a versioned instruction system that gives AI coding agents a consistent way to build with NDS.

Who It's For

Built for teams and individuals delivering, adapting, or learning government-grade web development.

Government teams & agencies

Delivering DGA-aligned digital services on their existing technology stack.

Freelancers

Building client sites with a reusable component library and ready-to-use page templates.

Students & fresh graduates

Learning core HTML, CSS, and vanilla JavaScript from a readable, production-grade codebase.

Teachers & trainers

Using real components, page templates, and patterns as practical material for web-development courses, bootcamps, or workshops.

Compliance Ready

DGA page templates implemented as working code and ready to be adapted for deployment.

Components follow the defined design tokens, typography, spacing, and interaction patterns. The templates below cover common government service screens and can be copied, populated with project content, and adapted for deployment.

Home Page Template

Organization home page with a main hero slider, headline figures, a services card deck, a news row, and a partner logo strip.

Form Template

Multi-step form layout with grouped text inputs, side stepper (vertical on desktop, radial on mobile), and a flat sub-hero.

Service Page Template

Government digital service with side info, breadcrumbs, and structured content layout.

Contact Us Template

Contact page with two-column form, country-code prefix, select, textarea, file upload, and a side info card with emergency contacts.

Content Template

Long-form editorial layout with article-style sections, numbered sub-sections, and a sticky on-this-page table of contents for in-page navigation.

Help & Support Template

Help hub with a flat sub-hero and a responsive grid of support-channel cards, each with a featured icon, description, availability, and response time.

About The Entity Template

Entity landing hub with a flat sub-hero and a responsive grid of topic cards, each with a featured icon, title, and navigation arrow.

FAQ Template

Frequently asked questions layout with a flat sub-hero, large accordion list, and a feedback call-to-action card for routing unresolved inquiries to support.

e-Participation Template

Engagement topics hub with a sub-hero and a responsive 4-column grid of text-only navigation cards for citizen participation entry points.

Social Media Template

Social channels hub with a flat sub-hero and a responsive grid of platform cards, each with a featured icon, name, and navigation arrow.

KPIs Template

Performance dashboard combining KPI counter tiles, pie, donut, line, and bar charts, and responsive data tables for portal and service statistics.

Search Template

Search results layout with keyword highlighting, filter/sort dropmenus, and paginated card list.

404 Template

Custom error page with illustration and back-to-home action.

Real-World Examples

8 composed pages demonstrating NDS components working together in government service contexts.

Services List

Filterable government services catalog with search and category filters.

Service Filter Search Pagination
Registration

Sign-up form with field validation, a matching password check, and an OTP step.

Form Forms OTP Validation
Sign In

National single sign-on with a credentials fallback, one-time code, and account settings.

Form Forms OTP Cooldown Button Alert
Faculty Profile

Faculty member page with profile, tabbed content, and structured academic information.

Content Tabs Avatar Definition List
Faculty CV

Long-form academic profile with a table of contents, a career timeline, qualifications, and paginated publications.

Content Stepper TOC Divider Pagination Cards
Academic Program

Degree program page with expandable content, curriculum, and admission information.

Content Expandable Accordion
Manage Records

Records screen with create, edit and delete, filters, expandable detail rows and CSV export.

Dashboard Tables Sub-Rows Modal Filter
Console

Admin console with charts, transactions, team directory, and notifications.

Dashboard Charts Tables Stats

Event Themes

Theme packs for national occasions. Each theme can be applied site-wide through a single attribute and removed to restore the default theme.

National Day 96 theme preview
National Day 96

Re-skin the whole site for Saudi National Day with one script tag: the official six-slide campaign hero, identity bars under every section, and a themed footer, in both light and dark mode.

Theme CSS JS
Details
Foundation Day theme preview
Foundation Day

Re-skin the whole site for Saudi Founding Day with one script tag: the heritage brown palette and a configurable bilingual hero slide, in both light and dark mode.

Theme CSS JS
Details
Hajj theme preview
Hajj

Re-skin the whole site for the Hajj season with one script tag: a Saudi-font hero, a direction-aware backdrop, and seasonal section accents, in both light and dark mode.

Theme CSS JS
Details

Components (98)

Each with its markup, styling, and JavaScript behavior. All built from scratch.

Accessibility

Site-wide panel for accessibility presets, typography tuning, and visual filters

Add-ons JS CSS Add-on API v1.0.5
Accordion

Expandable content panels with nested group support

UI JS CSS API v1.0.0
Alert

Contextual messages for status, warnings, and notifications

UI JS CSS API v1.0.0
Autocomplete

Type-ahead search with filtered suggestions

Forms JS CSS API v1.0.0
Avatar

Profile images, initials, and group stacks

UI CSS v1.0.0
Block

Spacing unit for content and block components inside a section body, with an optional title

Layout CSS v1.0.0
Breadcrumb

Hierarchical path showing the current page location

UI JS CSS API v1.0.0
Buttons

Interactive actions with multiple variants, sizes, and states

UI CSS v1.0.0
Cards

Versatile content containers for articles, profiles, and actions

UI CSS v1.0.0
Chart

Lightweight SVG charts: bar, line, pie, and donut

Data JS CSS API v1.0.0
Checkbox

Multi-select toggles for options and preferences

Forms CSS v1.0.0
Chips

Compact labels for tags, filters, and selections

UI CSS v1.0.0
Clock

Real-time clock with Hijri/Gregorian date

UI Shell JS API v1.0.0
Code

Formatted code blocks with syntax highlighting and copy

UI JS CSS API v1.0.0
Content Placeholder

Dashed stand-in marking a region a real component will replace

Utilities CSS v1.5.0
Content Switcher

Toggle between content sections within the same space on the screen

UI JS CSS API v1.6.0
Cookies

Privacy-compliant cookie management banner

Utilities JS CSS API v1.0.0
Cooldown Button

Click-disabled countdown button for resend, retry, and rate-limited actions

UI JS CSS API v1.0.0
Copy

One-click clipboard copy with checkmark feedback and screen reader announcement

Utilities JS CSS API v1.0.0
Counter Animation

Scroll-triggered animated counters that count up to a target value

Utilities JS v1.0.0
Currency

SAR and international currency symbols appended automatically via data attribute

Utilities JS CSS v1.0.0
Custom Select

Styled single-choice dropdown with custom option markup and a JS API, built on dropmenu

Forms JS CSS API v1.0.0
Date Picker

Hijri/Gregorian calendar with dual date conversion

Forms JS CSS API v1.0.0
Definition List

Structured key-value pairs in grid or list layouts

UI CSS v1.0.0
DGA Digital Stamp

Government authority verification panel

UI Shell JS CSS v1.0.0
Divider

Horizontal or vertical rule with optional centered label

Utilities CSS v1.0.0
Document Head

Critical CSS, deferred bundles, and the inline gate every page loads in its head

UI Shell JS CSS v1.1.0
Drawer

Collapsible navigation lists with accordion groups

UI JS CSS API v1.0.0
Dropmenu

Toggle-activated overlay for actions and navigation

UI JS CSS API v1.0.0
Editor

Rich text field that submits clean NDS markup, converting Word, Google Docs, and web pastes and inserting NDS components as blocks

Forms JS CSS API Beta v1.4.0
Empty

Parent-adaptive placeholder for containers with no content

UI JS CSS API v1.0.0
Expandable Content

Show more/less toggle for long content blocks

Utilities JS CSS v1.0.0
Export

Declarative CSV, Excel, and PDF downloads from any table, card list, or marked-up container

Data JS CSS API v1.1.0
Featured Icons

Decorative icon containers with shape and color options

UI CSS v1.0.0
Feedback Icons

Semantic status icons for success, error, and info

UI CSS v1.0.0
File Upload

Drag-and-drop file input with preview and validation

Forms JS CSS API v1.0.0
Filter

Applied filters with search, URL sync, and remote data

Data JS CSS API v1.0.0
Flex

Quick alignment, direction, and wrapping with custom-property overrides

Layout CSS v1.0.0
Floating Action Button

FAB that pins to a viewport corner and stacks with others

UI JS CSS API v1.5.0
Footer

Multi-column footer with light and green variants

UI Shell CSS v1.0.0
Grid

Responsive column system with flexible breakpoints

Layout CSS v1.0.0
Header

The region at the top of the page where the top bar, digital stamp panel, and main navigation compose

UI Shell CSS v1.0.0
Hero

Full-width page banners with slider and call-to-action

UI Shell JS CSS v1.0.0
Helper Classes

Single-purpose classes for your own markup: centering, spacing reset, direction isolation, brand text color, and notes

Utilities CSS v1.7.0
Hidden

Visibility utilities: the hidden attribute honored everywhere and band-exact responsive hiding with data-hidden

Utilities CSS v1.4.0
Icons

The HugeIcons Stroke Rounded font for content plus a curated inline SVG set for components and chrome, with sizing, color, and license guidance

Foundations CSS v1.4.0
Image Popup Viewer

IPV fullscreen image preview with zoom and navigation

UI JS CSS API v1.0.0
Link

Inline navigation with color variants and automatic external-link detection

UI CSS JS v1.0.0
Loading

Spinners and skeleton placeholders for loading states

UI CSS v1.0.0
Main Navigation

Primary navigation bar with branding, mega-menu dropdowns, utility actions, and a mobile drawer

UI Shell JS CSS API v1.0.0
Metric

Dashboard tile pairing a key statistic with an inline sparkline

Data CSS v1.0.2
Modal

Focused dialog overlays for confirmations and forms

UI JS CSS API v1.0.0
Multiselect

Multi-option select over a native checkbox group: removable chips, JSON-populated options, staged or instant commit

Forms JS CSS API v1.0.0
Number Input

Numeric field with increment and decrement controls, min/max, and step

Forms JS CSS v1.0.0
Numbers

Locale-aware thousand separators for any number on the page

Utilities JS API v1.0.0
OTP Input

Segmented one-time password fields with auto-advance

Forms JS CSS API v1.0.0
Password

Password field with live strength rules and confirm-match checking

Forms JS CSS API v1.7.0
Pagination

Page-by-page navigation for large data sets

UI JS CSS API v1.0.0
Page Shell

The body structure every page shares, with the classes that switch chrome shape

Layout CSS v1.8.0
Panels

Content-agnostic surface that slides in from any edge of the viewport

UI JS CSS API v1.5.0
Persona

Identity block with avatar, name, role, and optional action row

UI CSS v1.0.0
Progress

Visual indicators for task completion and loading

UI JS CSS API v1.0.0
Prose

Default styling for classless flowing content from editors and CMSs

Layout CSS v1.7.0
Quote

Semantic quotation block with optional title and author attribution

UI CSS v1.0.0
Radio

Single-choice selection within a group

Forms CSS v1.0.0
Rating

Star-based display and input for user ratings

UI JS CSS API v1.0.0
Refresh

One call that tells every live component the contents of a container changed

Core JS API v1.7.0
Request

Fetch wrapper with a timeout, a response size cap, and errors you can branch on

Core JS API v1.6.0
Saudi Cities

Bundled JSON dataset of 132 Saudi Arabian cities with bilingual names, drop-in for autocomplete and address flows

Utilities Data v1.0.0
Scroll More

Overflow wrapper with edge mask-fade and sticky show-more button

UI JS CSS API v1.0.0
Section

Page content sections with head, body, and action areas

Layout CSS v1.0.0
Selection

Selected-items counter for tables, card grids, and checkbox lists, with a records-line swap while a selection is active

Data JS API v1.4.0
Selects

Native dropdown menus for choosing from a list

Forms JS CSS v1.0.0
Share

Social share dropmenu for X, LinkedIn, WhatsApp, and copy link

Utilities JS CSS v1.0.0
Side Info

Companion column for service details, progress, and in-page navigation

UI Shell JS CSS API v1.0.0
Side Menu

Collapsible nested sidebar navigation

UI Shell JS CSS v1.0.0
Slider

Numeric range input with single-thumb and dual-thumb modes for picking a value or a min–max span

Forms JS CSS API v1.2.0
Sort

DOM-reorder engine for lists, grids, and tables with type auto-detect and URL sync

Data JS API v1.0.0
Status Section

Whole-page or inline outcome message with a status icon, a title, and one action

Layout CSS v1.10.0
Stepper

Sequential step indicators for multi-stage workflows

UI JS CSS API v1.0.0
Swiper

Touch-enabled carousel for images and content slides

UI JS CSS API v1.0.0
Switch

Binary on/off toggles for settings and preferences

Forms CSS v1.0.0
Tables

Data grids with sorting, pagination, and expandable rows

Data JS CSS API v1.0.0
Tabs

Switchable content panels with horizontal tab navigation

UI JS CSS API v1.0.0
Tag Input

Free-text tags committed as removable chips while typing, posted natively as an array

Forms JS CSS API v1.4.0
Tags

Small labels for categorization and metadata

UI CSS v1.0.0
Text Inputs

Single-line fields with labels, icons, and validation

Forms JS CSS v1.0.0
Textareas

Resizable multi-line text fields

Forms JS CSS v1.0.0
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

Foundations CSS JS v1.1.0
TOC

Auto-populated in-page table of contents with active-section tracking

UI JS CSS API v1.0.0
Tokens

Every CSS custom property in the system: palette, primitive scales, semantic meanings, and component dials to reference and override

Foundations CSS v1.2.0
Toolbar

Controls bar above a table, list, or grid: result counts and applied filters lead, export and actions trail

UI CSS v1.4.0
Tooltip

Click-activated balloon for contextual help next to a term or field

UI JS CSS API v1.0.0
Top Bar

Government branding bar with date, weather, and dark mode toggle

UI Shell JS CSS v1.0.0
Truncate Text

Line-clamped overflow with expand/collapse toggle

Utilities CSS v1.0.0
User Feedback

Satisfaction surveys and inline rating forms

Forms JS CSS v1.0.0
Voice Input

Voice-to-text button that dictates into a text field, with Arabic/English auto-detection

Forms JS API v1.0.0
Weather Widget

Live weather display from GPS coordinates

UI Shell JS CSS API v1.0.0
Performance

Architecture & Performance

Built with a performance-first and compatibility approach.

View the PageSpeed Insights report

Zero Dependencies

No Bootstrap, Tailwind, jQuery, or framework runtime. The output is plain HTML, CSS, and JavaScript and can be integrated into existing stacks without introducing a framework dependency.

Smart Component Loader

A single DOM sweep detects the components present on a page and initializes them in priority tiers: critical components first, followed by the rest during idle time. Deferred and page-specific bundles are loaded only when their components are present, limiting each page to the JavaScript it actually 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 for customization while keeping internal implementation details 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)

Critical styles load immediately, while non-critical styles are deferred and loaded asynchronously without blocking rendering. The build separates critical and non-critical CSS.

5-Stage Reveal

First paint is divided into five render-safe stages: inline critical skeleton → critical stylesheet → main stylesheet → main JavaScript → icons and font. Each stage either renders correctly or remains hidden, preventing unstyled flashes; icons load last to stay outside the LCP window.

~41 KB Core JS (gzipped)

The full library is ~133 KB gzipped, but it is not loaded as a single bundle. A lean ~41 KB core loads on every page, while late-safe and page-specific components are loaded only when their markup is present. A typical page therefore executes only a fraction of the library.

Web Vitals Compliant

100% Google PageSpeed score, with LCP, CLS, and INP passing in the measured test. Performance is tested across desktop and mobile conditions, including fast and limited connections.

Sleek Animations

GPU-accelerated animations and scheduled rendering keep transitions responsive, including on lower-end devices. Off-screen elements are deferred until needed.

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

NDS is designed to work with AI coding agents, with NDS IQ providing the instructions and Get Started guiding the setup and workflow.

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.

Get Started

Everything needed to adopt NDS: download the template, install the agent instructions, build the UI page by page, and stay current with upgrades.