govuk-webcomponents

0.0.3 • Public • Published

govuk-webcomponents

A set of encapsulated Web Components consuming the GOV.UK Design System.

npm

Please note this package is not affiliated to GOV.UK but consumes code as distributed in the govuk-frontend npm package (v3.8.0).

Installation

npm install --save govuk-webcomponents

Components

Please visit the Storybook site for demos and code examples.

Usage

The web components are distributed as ES modules and can be used with any platform.

Modern browsers (Bare module specifiers)

To quickly try the components import the modules directly in the browser and serve with a process that supports bare module specifier resolution such as es-dev-server.

<body>
  <govukwc-button label="Save and continue"></govukwc-button>
  <script type="module">
    import 'govuk-webcomponents/components/govukwc-button/govukwc-button';
  </script> 
</body>

Browsers to IE11 (Compiling to ES5)

To support browsers (down to IE11) a combination of polyfills and build steps will need to be taken.

At a highlevel outline the following is required:

  • Transpiling to ES5 will be required using build tools such as Webpack or Rollup.
  • The webcomponents.js pollyfills will need to be loaded.

Package Sidebar

Install

npm i govuk-webcomponents

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

483 kB

Total Files

132

Last publish

Collaborators

  • tgreyuk