lit

A library for building fast, lightweight web components

lit downloads lit version lit license

lit유사 패키지:

npm 다운로드 트렌드

3 년
🌟 lit의 README.md에 실시간 사용 차트를 표시하려면 아래 코드를 복사하세요.
## Usage Trend
[![Usage Trend of lit](https://npm-compare.com/img/npm-trend/THREE_YEARS/lit.png)](https://npm-compare.com/lit#timeRange=THREE_YEARS)

Cumulative GitHub Star Trend

🌟 lit의 README.md에 GitHub Stars 트렌드 차트를 표시하려면 아래 코드를 복사하세요.
## GitHub Stars Trend
[![GitHub Stars Trend of lit](https://npm-compare.com/img/github-trend/lit.png)](https://npm-compare.com/lit)

통계 세부사항

패키지
다운로드
Stars
크기
Issues
발행일
라이선스
lit10,236,94721,899106 kB7466ヶ月前BSD-3-Clause

lit의 README

Lit

Simple. Fast. Web Components.

Build Status Published on npm Join our Discord Mentioned in Awesome Lit

Lit is a simple library for building fast, lightweight web components.

At Lit's core is a boilerplate-killing component base class that provides reactive state, scoped styles, and a declarative template system that's tiny, fast and expressive.

Documentation

See the full documentation for Lit at lit.dev

Overview

Lit provides developers with just the right tools to build fast web components:

  • A fast declarative HTML template system
  • Reactive property declarations
  • A customizable reactive update lifecycle
  • Easy to use scoped CSS styling

Lit builds on top of standard web components, and makes them easier to write:

import {LitElement, html, css} from 'lit';
import {customElement, property} from 'lit/decorators.js';

// Registers the element
@customElement('my-element')
export class MyElement extends LitElement {
  // Styles are applied to the shadow root and scoped to this element
  static styles = css`
    span {
      color: green;
    }
  `;

  // Creates a reactive property that triggers rendering
  @property()
  mood = 'great';

  // Render the component's DOM by returning a Lit template
  render() {
    return html`Web Components are <span>${this.mood}</span>!`;
  }
}

Once you've defined your component, you can use it anywhere you use HTML:

<my-element mood="awesome"></my-element>

Contributing

Please see CONTRIBUTING.md.