GithubHelp home page GithubHelp logo

pinkhominid / lit-html Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lit/lit

0.0 2.0 0.0 1.8 MB

HTML template literals in JavaScript

Home Page: https://polymer.github.io/lit-html/

License: BSD 3-Clause "New" or "Revised" License

JavaScript 0.34% TypeScript 98.07% HTML 1.59%

lit-html's Introduction

๐Ÿ›  Status: In Development

lit-html is currently in development. It's on the fast track to a 1.0 release, so we encourage you to use it and give us your feedback, but there are things that haven't been finalized yet and you can expect some changes.

lit-html

Efficient, Expressive, Extensible HTML templates in JavaScript

Build Status Published on npm Mentioned in Awesome lit-html

Documentation

Full documentation is available at polymer.github.io/lit-html.

Overview

lit-html lets you write HTML templates in JavaScript with template literals.

lit-html templates are plain JavaScript and combine the familiarity of writing HTML with the power of JavaScript. lit-html takes care of efficiently rendering templates to DOM, including efficiently updating the DOM with new values.

import {html, render} from 'lit-html';

// This is a lit-html template function. It returns a lit-html template.
const helloTemplate = (name) => html`<div>Hello ${name}!</div>`;

// This renders <div>Hello Steve!</div> to the document body
render(helloTemplate('Steve'), document.body);

// This updates to <div>Hello Kevin!</div>, but only updates the ${name} part
render(helloTemplate('Kevin'), document.body);

lit-html provides two main exports:

  • html: A JavaScript template tag used to produce a TemplateResult, which is a container for a template, and the values that should populate the template.
  • render(): A function that renders a TemplateResult to a DOM container, such as an element or shadow root.

Installation

$ npm install lit-html

Status

lit-html is under active development and has not yet had a 1.0 release. The internal API may still change somewhat. The html and render API is stable.

Contributing

Please see CONTRIBUTING.md.

lit-html's People

Contributors

alexendoo avatar arjunyel avatar bgotink avatar bicknellr avatar cdata avatar dakmor avatar dakotajang avatar dfreedm avatar fopsdev avatar graynorton avatar jridgewell avatar justinfagnani avatar keanulee avatar kevinpschaaf avatar larsdenbakker avatar mysticatea avatar neo avatar patrickjs avatar peterpme avatar ruphin avatar samuelli avatar sunesimonsen avatar sunhuawei avatar therocco avatar usergenic avatar vikdotdev avatar web-padawan avatar zachcd avatar zeroliu avatar zhaoz avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.