An open API service indexing awesome lists of open source software.

https://github.com/rbardini/html

Tiny html tag function for no-build JSX-like syntax, compatible with all modern browsers and runtimes.
https://github.com/rbardini/html

html jsx literal string tagged template

Last synced: 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# @rbardini/html

![JSR](https://img.shields.io/jsr/v/@rbardini/html)
![npm](https://img.shields.io/npm/v/@rbardini/html)

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

```ts
import { html } from '@rbardini/html'

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

const list = ({ title, items }) =>
html`
${title && heading(title)}


    ${items.map((item) => html`
  • ${item}
  • `)}

`
```

Inspired by [jimniels/html](https://github.com/jimniels/html).

## Usage

```sh
# Deno
deno add @rbardini/html

# npm
npm install @rbardini/html
```

Or copy-paste the contents of [`mod.ts`](./mod.ts).