A web component checkbox.
npm i -S @substrate-system/check-boxThis exposes ESM and common JS via package.json exports field.
import { CheckBox } from '@substrate-system/check-box'import '@substrate-system/check-box/css'Or minified:
import '@substrate-system/check-box/min/css'check-box {
--primary-accent: black;
--primary-highlight: #00bbcb;
}This calls the global function customElements.define. Just import, then use
the tag in your HTML.
import '@substrate-system/check-box'<div>
<check-box></check-box>
</div>This package exposes minified JS and CSS files too. Copy them to a location that is accessible to your web server, then link to them in HTML.
cp ./node_modules/@substrate-system/check-box/dist/index.min.js ./public/check-box.min.js
cp ./node_modules/@substrate-system/check-box/dist/style.min.css ./public/check-box.css<head>
<link rel="stylesheet" href="./check-box.css">
</head>
<body>
<!-- ... -->
<script type="module" src="./check-box.min.js"></script>
</body>