Skip to content
/ html Public

Tiny html tag function for no-build JSX-like syntax, compatible with all modern browsers and runtimes.

License

Notifications You must be signed in to change notification settings

rbardini/html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@rbardini/html

JSR npm

Tiny html tag function for no-build JSX-like syntax, compatible with all modern browsers and runtimes.

import { html } from '@rbardini/html'

const heading = ({ level = 1, children }) =>
  html`<h${level}>${children}</h${level}>`

const list = ({ title, items }) =>
  html`
    ${title && heading(title)}
    <ul>
      ${items.map((item) => html`<li>${item}</li>`)}
    </ul>
  `

Inspired by jimniels/html.

Usage

# Deno
deno add @rbardini/html

# npm
npm install @rbardini/html

Or copy-paste the contents of mod.ts.

About

Tiny html tag function for no-build JSX-like syntax, compatible with all modern browsers and runtimes.

Topics

Resources

License

Stars

Watchers

Forks