Skip to content

Getting started

Neobrutalist custom elements that work in TypeScript and vanilla HTML/CSS/JS apps. Built with Lit and Vite; Lit is bundled into the build, and also listed as a dependency so TypeScript can resolve its types.

Terminal window
npm install @nicomiguelino/neobrutalist-web-components

Importing the library registers the custom elements. After that, use them like any HTML tag.

import '@nicomiguelino/neobrutalist-web-components'
<script type="module">
import '@nicomiguelino/neobrutalist-web-components'
</script>
<nb-button>Click me</nb-button>
<nb-button variant="accent">Accent</nb-button>

This form needs the package to be resolvable (via a bundler, an import map, or a CDN URL), and it must be served over HTTP. Browsers block module scripts on file:// pages.

Vanilla HTML with a classic script (no modules, no bundler)

Section titled “Vanilla HTML with a classic script (no modules, no bundler)”

The UMD build works in a plain <script> tag and even from file://. It registers the elements and exposes a global named NeobrutalistWebComponents:

<script src="./dist/neobrutalist-web-components.umd.js"></script>
<nb-button>Click me</nb-button>
<script>
console.log(NeobrutalistWebComponents) // { NbButton, define }
</script>

Lit is bundled into both builds, so there is nothing else to load.