Fawn Components

A simple components package for modern web

Install

fawn-components is distributed on npm, so you can install it locally or use it via npm CDNs like unpkg.com.

Local Installation

npm i fawn-components

CDN

npm CDNs like unpkg.com can directly serve files that have been published to npm. This works great for standard JavaScript modules that the browser can load natively.

For this element to work from unpkg.com specifically, you need to include the ?module query parameter, which tells unpkg.com to rewrite "bare" module specificers to full URLs.

HTML

<script type="module" src="https://unpkg.com/fawn-components?module"></script>

Note: This will import the whole components

Seperate components

<script type="module" src="https://unpkg.com/fawn-components@latest/lib/fn-pwa-banner.js?module"></script>

In place of fn-pwa-banner replace it with the component you want to you

Example:

<script type="module" src="https://unpkg.com/fawn-components@latest/lib/fn-ripple-btn.js?module"></script>

JavaScript

import 'https://unpkg.com/fawn-components?module';