godown
v3.14.2
Published
Atomic Web Component Library.
Maintainers
Readme
godown
Atomic Web Component Library.
Install
npm i godownImport
Import one component.
import Alert from "godown/alert.js";Import all components.
import { Alert } from "godown";Usage
HTML
<godown-alert title="Alert"></godown-alert>JS
import { Alert } from "godown";
const alert = new Alert();
alert.title = "Alert";
document.body.appendChild(alert);React
React components is now in the standalone package (@godown/react).
import Alert from "@godown/react/alert";
export default function () {
return <Alert title="Alert" />;
}CSS variable
Element-scoped css variables will start with --${tagName}--.
<godown-button style="--godown-button--focus-scale: .95;"></godown-button>Undefined
Undefined elements at /web-components/${name}/component.js.
import Button "godown/web-components/button/component.js";
customElements.define("my-button", Button);<my-button>Click me</my-button>