Skip to main content

Home

Welcome

svelte-uswds is a Svelte component library that implements the U.S. Web Design System .

This library requires Svelte version 3.20 or greater. 1

Quick start

Installing

yarn add -D svelte-uswds

Adding styles

In your root svelte file, link a stylesheet from a CDN using the svelte:head API.

<!-- App.svelte -->
<svelte:head>
  <link
    rel="stylesheet"
    href="https://unpkg.com/uswds@2.6.0/dist/css/uswds.min.css" />
</svelte:head>

Importing components

Import components from the library.

<!-- App.svelte -->
<script>
  import { Button } from "svelte-uswds";
</script>

<Button>Hello world</Button>

Explore the component library .


Notes

1. This library uses the $$restProps API, which was released in Svelte v3.20.0 .