Dependencies

The Kaharagia Design System is designed to be lightweight with minimal external dependencies. Most components work with just CSS and vanilla JavaScript.

Core Requirements

The design system CSS has no external dependencies. Simply include the stylesheet and you're ready to build accessible government services.

RequirementVersionNotes
Modern browserSee browser supportCSS custom properties support required
Noto Sans fontLatestOptional - falls back to system fonts

CSS-Only Components

The following components work with CSS only, no JavaScript required:

  • Alerts
  • Back Link
  • Badge
  • Breadcrumbs
  • Buttons
  • Cards
  • Character Count (display only)
  • Checkboxes
  • Date Input
  • Details (uses native <details> element)
  • Empty States
  • File Download
  • File Upload
  • Inset Text
  • Lists
  • Pagination
  • Panel
  • Phase Banner
  • Progress Indicator
  • Radios
  • Search Box
  • Select
  • Skip Link
  • Spinner
  • Status Dot
  • Summary List
  • Tables
  • Tags
  • Text Input
  • Textarea
  • Timeline
  • Warning Text

JavaScript-Enhanced Components

These components require JavaScript for full functionality. The design system provides reference implementations, but you can implement them with any framework.

ComponentJavaScript Required ForDependencies
AccordionExpand/collapse behaviour, ARIA state managementNone - vanilla JS
AutocompleteSearch filtering, keyboard navigation, ARIANone - vanilla JS
Character CountReal-time character countingNone - vanilla JS
Cookie BannerConsent management, localStorageNone - vanilla JS
ModalOpen/close, focus trapping, escape key handlingNone - vanilla JS
NotificationAuto-dismiss, animationsNone - vanilla JS
Signature PadCanvas drawing, touch supportNone - uses HTML5 Canvas API
TabsTab switching, keyboard navigation, ARIANone - vanilla JS
TooltipShow/hide on hover/focusNone - vanilla JS

React Reference Implementations

For React projects, the design system documentation site includes reference implementations of interactive components. These use React 19 with no additional dependencies.

// Example: Using the Accordion component
import Accordion from '@/components/Accordion';

<Accordion
  items={[
    { title: 'Section 1', content: 'Content for section 1' },
    { title: 'Section 2', content: 'Content for section 2' },
  ]}
/>

Optional Enhancements

For specific use cases, you may want to add these optional dependencies. These are recommendations — you'll need to install and implement them in your own project.

Implementation note

Only signature_pad is used in the reference implementations. Other libraries are suggestions based on common government service needs. The design system CSS is designed to work with these libraries when you add them to your project.

Signature & Drawing

Use CaseSuggested LibraryNotes
Signature capturesignature_padSmooth signature drawing on canvas. Used in the Signature Pad component.

Date & Time

Use CaseSuggested LibraryNotes
Date picker (calendar)FlatpickrLightweight, accessible date picker with calendar UI
Date manipulationdate-fns or Day.jsModern date utilities. Much lighter than Moment.js

Form Validation

Use CaseSuggested LibraryNotes
Schema validationZodTypeScript-first schema validation. Framework agnostic.
React formsReact Hook FormPerformant form handling for React projects
Phone validationlibphonenumber-jsGoogle's libphonenumber for JS. Validates and formats international phone numbers.
Bank account validationiban.jsIBAN validation and formatting
Postcode validationpostcode-validatorValidates postcodes for multiple countries

File Handling

Use CaseSuggested LibraryNotes
Drag-and-drop uploadreact-dropzoneAccessible file drag-and-drop for React
File type detectionfile-typeDetect file type from Buffer/ArrayBuffer. Useful for security validation.
Image processingSharpHigh-performance image resizing (server-side, Node.js)

Document Generation

Use CaseSuggested LibraryNotes
PDF generationpdf-libCreate and modify PDFs in JavaScript. No external dependencies.
PDF from HTMLhtml2pdf.jsConvert HTML to PDF. Good for confirmation pages.
QR codesqrcodeGenerate QR codes for tickets, receipts, and reference numbers

Data Display

Use CaseSuggested LibraryNotes
Data tablesTanStack TableHeadless table utilities for sorting, filtering, pagination
ChartsChart.jsAccessible charting library with good defaults
MapsLeafletOpen-source mapping library

Rich Content

Use CaseSuggested LibraryNotes
Rich text editorTiptapHeadless, accessible rich text editing
Markdown renderingreact-markdownSafe markdown rendering for React

Internationalisation

Use CaseSuggested LibraryNotes
Translationsi18nextInternationalisation framework. Works with React, Vue, vanilla JS.
Number/currency formattingBuilt-in Intl APIUse native browser APIs: Intl.NumberFormat, Intl.DateTimeFormat

Build Tools

The design system CSS works with any build setup. For development convenience:

  • PostCSS - For CSS processing and autoprefixing
  • Sass/SCSS - Optionally compile from Sass if preferred
  • Tailwind CSS - Can be used alongside the design system tokens

Browser Support

The design system supports modern browsers:

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

Internet Explorer is not supported. CSS custom properties require modern browser support.