Draft U.S. Web Design Standards
The Draft U.S. Web Design Standards include a library of open source UI components and a visual style guide for U.S. federal government websites.
This repository is for the Standards themselves. 18F maintains another repository for the documentation and website. To see the Standards and documentation on the web, visit https://standards.usa.gov.
- Recent updates
- Getting started
- Using the Standards
- Need installation help?
- Contributing to the code base
- Reuse of open-source style guides
- Licenses and attribution
The components and style guide of the Draft U.S. Web Design Standards follow industry-standard web accessibility guidelines and use the best practices of existing style libraries and modern web design. The U.S. Digital Service and 18F created and maintain the Draft U.S. Web Design Standards for designers and developers. They are designed for use by government product teams who want to create beautiful, easy-to-use online experiences for the public. To learn more about the project, check out this blog post and to view websites and applications check out our list here.
Information about the most recent release of the Standards can always be found in the release history. We include details about significant updates and any backwards incompatible changes along with a list of all changes.
We’re glad you’d like to use the Standards — here’s how you can get started:
- Designers: Check out our Getting Started for Designers information.
- Developers: Follow the instructions in this README to get started.
Using the Standards
There are a few different ways to use the Standards within your project. Which one you choose depends on the needs of your project and how you are most comfortable working. Here are a few notes on what to consider when deciding which installation method to use:
Download the Standards if:
- You are not familiar with
npmand package management.
Use the Standards
npm package if:
- You are familiar with using
npmand package management.
- You would like to leverage Standards Sass files.
Download the Standards zip file and open that file.
After extracting the zip file you should see the following file and folder structure:
uswds-0.14.0/ ├── js/ │ ├── uswds.min.js.map │ ├── uswds.min.js │ └── uswds.js ├── css/ │ ├── uswds.min.css.map │ ├── uswds.min.css │ └── uswds.css ├── img/ └── fonts/
Copy these files and folders into a relevant place in your project's code base. Here is an example structure for how this might look:
You'll notice in our example above that we also outline a
assetsfolder. These folders are to help organize any assets that are unique to your project.
Here is an example of how to reference these assets in your
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>My Example Project</title> <link rel="stylesheet" href="assets/uswds-0.14.0/css/uswds.min.css"> </head> <body> <script src="assets/uswds-0.14.0/js/uswds.min.js"></script> </body> </html>
NOTE: This version of the Standards includes jQuery version
And that’s it — you should now be able to copy our code samples into our
index.html and start using the Standards.
Install using npm
npm is a package manager for Node based projects. The Draft U.S. Web Design Standards maintains a
uswds package for you to utilize both the pre-compiled and compiled files on your project.
Node/npm. Below is a link to find the install method that coincides with your operating system:
- Node v4.2.3+, Installation guides
Note for Windows users: If you are using Windows and are unfamiliar with
npm, we recommend following Team Treehouse's tutorial for more information.
Make sure you have installed it correctly:
npm -v 3.10.8 # This line may vary depending on what version of Node you've installed.
package.jsonfile. You can do this manually, but an easier method is to use the
npm initcommand. This command will prompt you with a few questions to create your
uswdsto your project’s
npm install --save uswds
uswds module is now installed as a dependency. You can use the un-compiled files found in the
src/ or the compiled files in the
node_modules/uswds/ ├── dist/ │ ├── css/ │ ├── fonts/ │ ├── img/ │ ├── js/ └── src/ ├── fonts/ ├── img/ ├── js/ └── stylesheets/
Since you are already using
npm, the Draft U.S. Web Design Standards team recommends leveraging the ability to write custom scripts. Here are some links to how we do this with our docs website using
The Standards are easily customizable using the power of Sass (Syntactically Awesome Style Sheets). The main Sass (SCSS) source file is located here:
Global variables are defined in the
node_modules/uswds/src/stylesheets/core/_variables.scss file. Custom theming can be done by copying the
_variables.scss file into your own project’s Sass folder, changing applicable variable values, and importing it before
Below is an example of how you might setup your main Sass file to achieve this:
@import 'variables.scss' # Custom Sass variables file @import 'node_modules/uswds/src/stylesheets/uswds.scss';
You can now use your copied version of
_variables.scss to override any styles to create a more custom look and feel to your application.
Use another framework or package manager
If you’re using another framework or package manager that doesn’t support
npm, you can find the source files in this repository and use them in your project. Otherwise, we recommend that you follow the download instructions. Please note that the core team isn’t responsible for all frameworks’ implementations.
If you’re interested in maintaining a package that helps us distribute the Draft U.S. Web Design Standards, the project’s build system can help you create distribution bundles to use in your project. Please read our contributing guidelines to locally build distributions for your framework or package manager.
Need installation help?
Do you have questions or need help with setup? Did you run into any weird errors while following these instructions? Feel free to open an issue here:
You can also email us directly at email@example.com.
Contributing to the code base
For complete instructions on how to contribute code, please read CONTRIBUTING.md. These instructions also include guidance on how to set up your own copy of the Standards style guide website for development.
Reuse of open-source style guides
Much of the guidance in the Draft U.S. Web Design Standards leans on open source designs, code, and patterns from other civic and government organizations, including:
- Consumer Financial Protection Bureau’s Design Manual
- U.S. Patent and Trademark Office’s Design Patterns
- Healthcare.gov Style Guide
- UK’s Government Digital Service’s UI Elements
- Code for America’s Chime Styleguide
- Pivotal Labs Component Library
Licenses and attribution
A few parts of this project are not in the public domain. Attribution and licensing information for those parts are described in detail in LICENSE.md.
The rest of this project is in the worldwide public domain, released under the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication alongside the public domain portions of this project. For more information, see CONTRIBUTING.md.