UI Tool Guidance
Guidance for using the GOV.UK Design System UI tools and updating the site.
Getting Started
The GOV.UK Design System provides a comprehensive set of components and patterns for building government services.
Key Principles
- Start with user needs
- Make services accessible
- Design for consistency
- Use plain English
- Test with users
Using Components
Components are reusable parts of the user interface that have been designed and tested to work across different services.
Adding a new component
- Check the GOV.UK Design System components library
- Copy the HTML and CSS from the component page
- Add the component to your template
- Test the component with users
Customizing components
You can customize components by:
- Using variant classes (e.g.,
govuk-button--secondary) - Adding custom CSS classes
- Overriding default styles with your own CSS
Updating the Site
Follow these steps to update the site safely:
- Make changes in a development environment
- Test changes thoroughly
- Check accessibility with automated tools
- Test with users if possible
- Deploy to production
File Structure
The site uses the following structure:
/gov_website/
├── server.js # Main server file
├── package.json # Dependencies
├── views/ # Templates
│ ├── layouts/ # Base templates
│ ├── admin/ # Admin pages
│ └── *.html # Page templates
├── public/ # Static assets
│ ├── stylesheets/ # CSS files
│ ├── javascripts/ # JS files
│ └── images/ # Images
└── node_modules/ # Dependencies
Common Tasks
Testing and Accessibility
All updates should be tested for:
- Accessibility (WCAG 2.1 AA compliance)
- Cross-browser compatibility
- Mobile responsiveness
- Form validation
- Error handling
Testing Tools
- WAVE Web Accessibility Evaluator
- axe DevTools
- W3C Markup Validator
- Browser developer tools