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.
- Host: GitHub
- URL: https://github.com/rbardini/html
- Owner: rbardini
- License: mit
- Created: 2024-08-02T14:57:31.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-09-15T17:26:51.000Z (9 months ago)
- Last Synced: 2025-03-26T07:03:31.222Z (3 months ago)
- Topics: html, jsx, literal, string, tagged, template
- Language: TypeScript
- Homepage: https://npm.im/@rbardini/html
- Size: 7.81 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @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)}
- ${item} `)}
${items.map((item) => html`
`
```
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).