import { LitElement, html, property, customElement } from 'lit-element';
@customElement('custom-greeting')
export class CustomGreeting extends LitElement {
@property() name = 'World';
render() {
return html`<p>Hello, ${this.name}!</p>`;
}
}
<custom-greeting name="Everyone"></custom-greeting>
Express your UI declaratively, as a function of state. Levergage the full expressiveness of JavaScript in your templates – no custom syntax required.
Elements update automatically when their properties change. And they update fast, without diffing.
Whether your end users are in emerging markets or Silicon Valley, they’ll appreciate that LitElement is extremely fast.
LitElement uses lit-html to define and render HTML templates. DOM updates are lightning-fast, because lit-html only re-renders the dynamic parts of your UI.
LitElement follows the Web Components standards, so your components will work with any framework.
LitElement uses Custom Elements for easy inclusion in web pages, and Shadow DOM for encapsulation. There’s no new abstraction on top of the web platform.
Try LitElement in our live tutorial. You don’t need to install anything.
When you’re ready to dive in, set up LitElement locally and start building components!