qing-button
v9.0.1
Published
Button component for qing
Downloads
7
Readme
qing-button
A simple button component based on lit.
Demo
Installation
npm i qing-button litUsage
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.disableSelectedStyle: booleanopts out of default dimmed background when selected.
Events
clickfires when clicked, doesn't bubble up.
CSS Shadow Parts
buttonthe underlying button.
qing-button.colored-border::part(button) {
border: 4px solid yellowgreen;
border-radius: 10px;
}CSS Variables
qing-button also has some CSS variables for quick customization.
--button-outline-color focus outline color, defaults to 8dc3eb.
Examples
See demo for more examples.
html`
<qing-button @click=${() => alert('Hello world')}>Default</qing-button>
<qing-button disabled>Disabled</qing-button>
<qing-button autofocus>Auto-focused</qing-button>
`;