Licence
MIT
Version
4.2.0
Deps
0
Size
9 kB
Vulns
0
Weekly
0
lit-button
Dead simple lit-element button
Installation
yarn add lit-button
Usage
Properties
disabled: booleanindicates whether the button is disabled.autofocus: booleanindicates whether the button is focused when the page loads.href: stringnavigates to the given URL when clicked on.
CSS Shadow Parts
buttonthe underlying button.
lit-button.colored-border::part(button) {
border: 4px solid yellowgreen;
border-radius: 10px;
}
CSS Variables
lit-button also has some CSS variables for quick customization.
--button-outline-color focus outline color, defaults to 8dc3eb.
Examples
html`
<lit-button @click=${() => alert('Hello world')}>Default</lit-button>
<lit-button disabled>Disabled</lit-button>
<lit-button autofocus>Auto-focused</lit-button>
`;
Build Instructions
yarn devbuilds the project in dev modeyarn buildbuilds and lints the project in production modeyarn serveruns a demo page in browser (you have to build the project first)yarn testruns UI tests