Simpler.Grants.gov Public Wiki
Grants.govSimpler.Grants.govGitHubDiscourse
  • 👋Welcome
  • GET INVOLVED
    • Why open source?
    • How to contribute code
    • How to file issues
      • Report a bug
      • Request a feature
      • Report a security vulnerability
    • Community guidelines
      • Code of Conduct
      • Reporting and removing content
      • Incident response protocol
    • Community events
      • Fall 2024 Coding Challenge
        • Event Submissions & Winners
      • Spring 2025 Collaborative Coding Challenge
        • Event Submissions & Winners
    • Communication channels
  • Product
    • Roadmap
    • Deliverables
      • 🏁Static site soft launch
      • 🏁Static site public launch
      • 🏁GET Opportunities
      • 🏁Open source onboarding
      • 🏁Co-Design Group planning
    • Decisions
      • ADR Template
      • ADRs
        • Dedicated Forum for Simpler.Grants.gov Community
        • Recording Architecture Decisions
        • Task Runner for the CI / CD Pipeline
        • API Language
        • Use Figma for design prototyping
        • ADR: Chat
        • DB Choices
        • API Framework and Libraries
        • Back-end Code Quality Tools
        • Front-end Language
        • Communications Tooling: Wiki Platform
        • Use Mural for design diagrams and whiteboarding
        • Ticket Tracking
        • Front-end Framework
        • Front-end Code Quality Tools
        • Front-end Testing & Coverage
        • Backend API Type
        • Front-end Testing & Coverage
        • Deployment Strategy
        • Use U.S. Web Design System for components and utility classes
        • FE server rendering
        • Use NPM over Yarn Architectural Decision Records
        • U.S. Web Design System in React
        • Communications Tooling: Video Conferencing
        • Back-end Production Server
        • Communications Tooling: Analytics Platform
        • Commit and Branch Conventions and Release Workflow
        • Cloud Platform to Host the Project
        • Infrastructure as Code Tool
        • Data Replication Strategy & Tool
        • HHS Communications Site
        • Communications Tooling: Email Marketing
        • Communications Tooling: Listserv
        • Use Ethnio for design research
        • Uptime Monitoring
        • Database Migrations
        • 30k ft deliverable reporting strategy
        • Public measurement dashboard architecture
        • Method and technology for "Contact Us" CTA
        • E2E / Integration Testing Framework
        • Logging and Monitoring Platform
        • Dashboard Data Storage
        • Dashboard Data Tool
        • Search Engine
        • Document Storage
        • Document Sharing
        • Internal Wiki ADR
        • Shared Team Calendar Platform
        • Cross-Program Team Health Survey Tool
        • Adding Slack Users to SimplerGrants Slack Workspace
        • Repo organization
        • Internal knowledge management
        • Migrate Existing API Consumers
      • Infra
        • Use markdown architectural decision records
        • CI/CD interface
        • Use custom implementation of GitHub OIDC
        • Manage ECR in prod account module
        • Separate terraform backend configs into separate config files
        • Database module design
        • Provision database users with serverless function
        • Database migration architecture
        • Consolidate infra config from tfvars files into config module
        • Environment use cases
        • Production networking long term state
    • Analytics
      • Open source community metrics
      • API metrics
  • DESIGN & RESEARCH
    • Brand guidelines
      • Logo
      • Colors
      • Grid and composition
      • Typography
      • Iconography
      • Photos and illustrations
    • Content guidelines
      • Voice and tone
    • User research
      • Grants.gov archetypes
  • REFERENCES
    • Glossary
  • How to edit the wiki
Powered by GitBook
On this page
  • Context and Problem Statement
  • Considered Options
  • Decision Outcome
  • Pros and Cons of the Options
  • Use the existing open source react-uswds library
  • Create our own React USWDS component library
  • Leave the responsibility to each project team
  • Links

Was this helpful?

Edit on GitHub
  1. Product
  2. Decisions
  3. ADRs

U.S. Web Design System in React

PreviousUse NPM over Yarn Architectural Decision RecordsNextCommunications Tooling: Video Conferencing

Last updated 1 year ago

Was this helpful?

  • Status: Accepted

  • Deciders: @sawyerh, @aligg, @lorenyu, @rocketnova

  • Date: 2022-12-05

Technical Story: #19

Context and Problem Statement

  • The U.S. Web Design System (USWDS) only provides HTML and CSS for its components. It includes a small bit of vanilla JS to add interactivity to some components like the date picker.

  • It's common for projects to write their own React components to output the USWDS HTML, to reduce the amount of boilerplate needed to use the USWDS components.

  • discovered that Nava engineers and designers universally agreed that being able to use a React USWDS component library when starting new projects would be valuable.

Considered Options

  • Use the existing open source

  • Create our own React USWDS component library

  • Leave the responsibility to each project team

Decision Outcome

Add as a template dependency, making it available to all teams who use the template. The primary reasons are to avoid reinventing the wheel and because it's overall a well-built and maintained library.

Pros and Cons of the Options

Pros

  • Includes React components for all USWDS components and patterns.

  • Fairly well maintained.

  • Intentionally does not include any non-USWDS components.

  • Supports USWDS v3 (latest version)

Cons

  • Not necessarily a con, but just to call it out: We've only done a lightweight review of their technical implementation and hygiene — there's testing and linting, no reported a11y issues are open in GitHub or reported in Storybook, but we haven't done a comprehensive review of their code or a full accessibility audit. We're operating on trust in Truss's technical expertise, and an assumption that the outputted HTML markup is close to identical to what USWDS provides, so any a11y issues would likely be on USWDS's end.

Create our own React USWDS component library

Nava could create our own React USWDS component library, similar to react-uswds.

Pros

  • We'd have full control over the technical approach and wouldn't have a dependency on another vendor to incorporate changes or release new versions.

Cons

  • Requires more time and effort than using an existing library. We'd have to build and maintain the library.

  • Reinventing the wheel. We can always fork react-uswds if it no longer meets our needs.

Leave the responsibility to each project team

This is the current approach. Each project team is responsible for creating their own React components for the USWDS components they need.

Pros

  • No additional work required from the Platform team.

Cons

  • Each project team has to spend time and effort building the components or making technical decisions related to how they'll integrate USWDS. Teams then have to write their own tests and fix their own bugs for these components. Overall a potential poor use of time and effort.

Links

Use the existing open source

react-uswds is maintained by Truss, another vendor in this space. . Truss also maintains a for designers.

This was the recommended approach coming out of .

They to a specific version, which means that a project cannot use a newer version of USWDS until react-uswds updates it on their end. In practice, this could mean that a project may have delayed access to new component styles or CSS bug fixes that USWDS releases.

Previous research by Kalvin and Shannon
react-uswds library
react-uswds
react-uswds library
A Storybook for it can be found here
USWDS Figma library
Kalvin and Shannon's research
pin the @uswds/uswds dependency version
Decision to use the USWDS
Kalvin and Shannon's research
Evaluation of react-uswds