@tiny-lit/core
TypeScript icon, indicating that this package has built-in type declarations

2.0.0-alpha.8 • Public • Published

@tiny-lit/core

Just another JavaScript library for building user interfaces using template literals

Usage

Html template

import { html, render } from '@tiny-lit/core';

const quote = message => html`
    <div>
        <blockquote>
            ${message}
        </blockquote>
    </div>
`;

render(
    quote(
        `
        Neque porro quisquam est 
        qui dolorem ipsum quia dolor sit amet, 
        consectetur, adipisci velit
        `
    ),
    document.body
);

List of templates

import { html, render } from '@tiny-lit/core';

const listItem = item => (
    html`<li>${item}</li>`.withKey(item)
);

const list = items => (
    html`
        <ul>
            ${items.map(listItem)}
        </ul>
    `
);

render(
    list(['pippo', 'pluto', 'paperino']),
    document.body
);

/@tiny-lit/core/

    Package Sidebar

    Install

    npm i @tiny-lit/core

    Weekly Downloads

    78

    Version

    2.0.0-alpha.8

    License

    MIT

    Unpacked Size

    21.1 kB

    Total Files

    18

    Last publish

    Collaborators

    • alenaksu