Skip to content

Installation ​

From npm ​

sh
npm install @vectorchi/fun-loader

Then import the package once, anywhere in your app:

js
import '@vectorchi/fun-loader';

That defines the <fun-loader> tag and registers every built-in theme. Now use it like any HTML tag:

html
<fun-loader theme="dev" icon="dots"></fun-loader>

Using React, Vue or Nuxt? Use the component instead: see React & Next.js, Vue or Nuxt.

From a CDN ​

No build step needed. Add one script tag:

html
<script src="https://cdn.jsdelivr.net/npm/@vectorchi/fun-loader@0.5"></script>

<fun-loader theme="thinking"></fun-loader>

The @0.5 pins you to 0.5.x releases. Until 1.0, a new minor version (0.6, 0.7) can include breaking changes, so move the pin up on purpose, after reading the changelog. Leave it out to always get the latest version.

unpkg works too: https://unpkg.com/@vectorchi/fun-loader@0.5.

What you get ​

ImportWhat it isSize
@vectorchi/fun-loaderThe element and all themes, registered automatically4.4 kB
@vectorchi/fun-loader/reactReact component4.5 kB
@vectorchi/fun-loader/vueVue component4.4 kB
@vectorchi/fun-loader/elementThe element only, nothing registered2.3 kB
@vectorchi/fun-loader/themes/<name>A single theme, with its long-wait linesup to 0.6 kB

Sizes are minified and compressed, excluding React and Vue themselves. You only ever load one of the first four. See Smaller builds for the last two.

Released under the MIT License.