npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@uswds-wc/layout

v2.5.3

Published

USWDS Layout Components - Web Components

Readme

@uswds-wc/layout

USWDS Layout Components - Page structure and content organization as Web Components.

Overview

The @uswds-wc/layout package provides web component versions of USWDS components for organizing page content and creating structured layouts.

Installation

npm install @uswds-wc/layout lit

Components

Identifier (<usa-identifier>)

Standard government website identifier footer section.

<usa-identifier>
  <div slot="logos">
    <img src="/logo.png" alt="Agency Logo">
  </div>
  <div slot="required-links">
    <usa-link href="/about">About</usa-link>
    <usa-link href="/accessibility">Accessibility</usa-link>
    <usa-link href="/privacy">Privacy Policy</usa-link>
  </div>
  <div slot="agency">
    <p>An official website of the Agency Name</p>
  </div>
</usa-identifier>

Features:

  • Government logo placement
  • Required links section
  • Agency information
  • Responsive layout

Process List (<usa-process-list>)

Numbered list for step-by-step processes or instructions.

<usa-process-list>
  <li>
    <h4>Step 1: Review Requirements</h4>
    <p>Read through all the requirements carefully.</p>
  </li>
  <li>
    <h4>Step 2: Complete Application</h4>
    <p>Fill out the application form completely.</p>
  </li>
  <li>
    <h4>Step 3: Submit Documents</h4>
    <p>Upload all required supporting documents.</p>
  </li>
  <li>
    <h4>Step 4: Wait for Review</h4>
    <p>Your application will be reviewed within 5 business days.</p>
  </li>
</usa-process-list>

Variants:

  • default - Standard numbered circles
  • small - Smaller circle size

Prose (<usa-prose>)

Structured content wrapper for long-form text with USWDS typography.

<usa-prose>
  <h1>Article Title</h1>
  <p class="usa-intro">This is an introductory paragraph.</p>

  <h2>Section Heading</h2>
  <p>Regular paragraph content with proper spacing and typography.</p>

  <ul>
    <li>List item one</li>
    <li>List item two</li>
    <li>List item three</li>
  </ul>

  <h3>Subsection</h3>
  <p>More content here.</p>
</usa-prose>

Features:

  • Automatic USWDS typography styles
  • Proper vertical rhythm
  • Responsive font sizing
  • Accessible heading hierarchy

Step Indicator (<usa-step-indicator>)

Visual progress indicator for multi-step processes.

<usa-step-indicator current-step="2">
  <usa-step-indicator-step status="complete">
    Personal Information
  </usa-step-indicator-step>
  <usa-step-indicator-step status="current">
    Household Status
  </usa-step-indicator-step>
  <usa-step-indicator-step>
    Supporting Documents
  </usa-step-indicator-step>
  <usa-step-indicator-step>
    Signature
  </usa-step-indicator-step>
  <usa-step-indicator-step>
    Review and Submit
  </usa-step-indicator-step>
</usa-step-indicator>

Properties:

  • current-step - Current step number (1-indexed)
  • counters: 'default' | 'small' - Step counter size
  • no-labels - Hide step labels on mobile
  • no-counters - Hide step numbers

Step Status:

  • complete - Completed step
  • current - Active step
  • (no status) - Future step

Usage Example

Multi-step Form with Progress

<usa-step-indicator current-step="1">
  <usa-step-indicator-step status="current">
    Basic Info
  </usa-step-indicator-step>
  <usa-step-indicator-step>
    Details
  </usa-step-indicator-step>
  <usa-step-indicator-step>
    Review
  </usa-step-indicator-step>
</usa-step-indicator>

<form id="step-1">
  <usa-text-input label="Full Name" required></usa-text-input>
  <usa-text-input label="Email" type="email" required></usa-text-input>

  <usa-button-group>
    <usa-button type="submit">Next Step</usa-button>
  </usa-button-group>
</form>

Process List with Icons

<usa-process-list>
  <li>
    <h4>
      <usa-icon name="check"></usa-icon>
      Create Account
    </h4>
    <p>Sign up for a new account using your email address.</p>
  </li>
  <li>
    <h4>
      <usa-icon name="mail"></usa-icon>
      Verify Email
    </h4>
    <p>Check your email and click the verification link.</p>
  </li>
  <li>
    <h4>
      <usa-icon name="settings"></usa-icon>
      Complete Profile
    </h4>
    <p>Fill out your profile information to get started.</p>
  </li>
</usa-process-list>

Identifier Footer

<footer>
  <usa-identifier>
    <div slot="logos">
      <img src="/logo.png" alt="Department Logo" class="usa-identifier__logo-img">
    </div>

    <div slot="required-links">
      <h4>Important Links</h4>
      <usa-link href="/about">About Us</usa-link>
      <usa-link href="/accessibility">Accessibility Support</usa-link>
      <usa-link href="/foia">FOIA Requests</usa-link>
      <usa-link href="/privacy">Privacy Policy</usa-link>
    </div>

    <div slot="agency">
      <p><strong>Agency Name</strong></p>
      <p>123 Government St, Washington, DC 20001</p>
    </div>
  </usa-identifier>
</footer>

Bundle Size

Gzipped: ~30 KB

Features

  • Content Structure - Organized layouts for government websites
  • Progress Tracking - Visual step indicators
  • Typography - USWDS-styled prose content
  • Accessibility - Semantic HTML and ARIA support
  • Responsive - Mobile-first responsive design
  • TypeScript - Full type definitions included

Common Patterns

Step Indicator with Form Navigation

import '@uswds-wc/layout';

const stepIndicator = document.querySelector('usa-step-indicator');
let currentStep = 1;

function nextStep() {
  if (currentStep < totalSteps) {
    currentStep++;
    stepIndicator.currentStep = currentStep;
    // Update form visibility
  }
}

function prevStep() {
  if (currentStep > 1) {
    currentStep--;
    stepIndicator.currentStep = currentStep;
    // Update form visibility
  }
}

Browser Support

  • Modern browsers (Chrome, Firefox, Safari, Edge)
  • ES2020+ required
  • Web Components v1 spec

Dependencies

  • @uswds-wc/core - Core utilities and base components
  • lit ^3.0.0 (peer dependency)

Development

# Build the package
pnpm run build

# Run tests
pnpm test

# Type checking
pnpm run typecheck

# Linting
pnpm run lint

Storybook

View live examples and interactive documentation:

USWDS Web Components Storybook

License

MIT

Repository

USWDS Web Components Monorepo

Related Packages

Contributing

See the main repository for contribution guidelines.