JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Buttons › basic usage › Reply To: basic usage
April 22, 2020 at 5:56 am
#100713
admin
Keymaster
We support Shadow DOM. Smart is one of the first Web Components libraries and can be used for building Web Components.
To use Smart with LitElement, you can use this approach:
import { LitElement, html, css } from ‘lit-element’;
Smart.EnableShadowDOM = true;
export class SuperElement extends LitElement {
static get styles() {
return css`
`;
}
render() {
return html`
<link rel="stylesheet" type="text/css" href="https://htmlelements.com/demos/source/styles/smart.default.css">
<smart-button>Click me</smart-button>
`;
}
}
customElements.define(‘super-element’, SuperElement);
Regards,
Boyko