9.0.0 • Published 1 month ago

@trussworks/react-uswds v9.0.0

Weekly downloads
3,069
License
Apache-2.0
Repository
github
Last release
1 month ago

@trussworks/react-uswds

All Contributors

npm version uswds version

npm downloads

ReactUSWDS Component Library

This is a frontend component library, built in React with Typescript, based on design patterns defined by the United States Web Design System (USWDS) 3.0. Our primary goal is to document and provide common UI components following the USWDS specification. This library removes a significant amount of overhead UI development for projects based on this standard.

A deployed instance of the ReactUSWDS Storybook is located at: https://trussworks.github.io/react-uswds/

Table of Contents

Install

Install this package with npm or yarn:

yarn add @trussworks/react-uswds

or

npm i @trussworks/react-uswds

Peer Dependencies

This library relies on some peer dependencies. Please verify these peer dependencies were added to your project (if they did not already exist) after adding this library.

Usage

USWDS

It is strongly suggested applications use the same version of USWDS that was used to build the version of ReactUSWDS they're using (see this repo's uswds devDependency in package.json). A version mismatch may result in unexpected markup & CSS combinations. For flexibility, ReactUSWDS will not trigger warnings if consumers choose to use a higher minor version of uswds (hence the careted uswds peerDependency in package.json). If encountering unexpected markup issues when choosing not to use the matching devDependency version of uswds, consumers should check whether aligning the versions resolves their issue(s).

You can import ReactUSWDS components using ES6 syntax:

import { Alert } from '@trussworks/react-uswds'

Warning: Do not include USWDS JS in your project alongside this library (i.e., using import 'uswds'), as that will result in some components that use JS (such as the ComboBox) to initialize twice.

Also make sure to include the following in order to import the compiled CSS from this project:

@import '~@trussworks/react-uswds/lib/index.css';

If you aren't already using USWDS as a dependency, you also need to import USWDS styles. Read more info about using USWDS styles and assets here

Having issues? See FAQs.

NodeJS

We develop on this library with the version of node defined in .node-version. We run the test suite against the major released versions of node that are still in active LTS and not development releases. Specific versions are defined in the workflow: .github/workflows/build-and-test.yml. Those are the versions we exxpect to support, if you are using a pre-release or development version of node you may run into unexpected issues.

Having issues? See FAQs.

Pre-Release

See prelease.md

Background

The primary deliverable is a published npm package that can be included as a dependency in other projects that use USWDS with React. In order for these components to be useful, they should follow best practices for accessible, semantic, markup; be well-tested across browsers and devices; and allow for an appropriate level of customization. We adhere to a set of development guidelines as much as possible and use automation to enforce tests, linting, and other standards.

Non-Goals

This is not meant to be a one-size-fits-all front end solution, We are starting off with the opinionated decision to cater towards projects that use the U.S. Design System 2.0, and encapsulate these specific styles and markup in React components.

In the process, we expect to gain learnings around how to best abstract out UI code from implementation; how to better standardize and document front end code practices; and how to develop, maintain, and distribute a shared JS library in alignment with our company values at Truss.

Active Maintainers

We are starting to rotate Trussel maintainer responsibilities. Check out the maintainers README.

Contributing

Interested in contributing? See our guidelines and dev setup here.

Are you a Trussel and new to this project? Check out our on & offboarding guide made just for you!

This repository is governed by the Contributor Covenant

Quick links:

License

Copyright 2021, TrussWorks, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

9.0.0

1 month ago

8.0.0

2 months ago

7.0.0

2 months ago

6.2.0

4 months ago

6.1.0

5 months ago

5.5.0

6 months ago

5.3.1

8 months ago

5.3.0

8 months ago

5.1.1

9 months ago

5.1.0

10 months ago

5.4.0

7 months ago

5.2.0

9 months ago

6.0.0

6 months ago

5.0.0

11 months ago

4.2.1

1 year ago

4.2.0

1 year ago

4.1.0

1 year ago

4.1.1

1 year ago

4.0.0

1 year ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

2.9.0

2 years ago

3.0.0

2 years ago

2.5.0

2 years ago

2.7.0

2 years ago

2.6.0

2 years ago

2.7.2

2 years ago

2.8.0

2 years ago

2.7.1

2 years ago

2.4.1

2 years ago

2.4.0

3 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.17.0

3 years ago

1.16.0

3 years ago

1.15.0

3 years ago

1.14.0

3 years ago

1.13.2

3 years ago

1.13.1

3 years ago

1.13.0

3 years ago

1.12.2

3 years ago

1.12.1

3 years ago

1.12.0

3 years ago

1.11.0

3 years ago

1.10.0

3 years ago

1.9.3

3 years ago

1.9.2

4 years ago

1.9.1

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago