Skip to content
/ h Public

A node html-string renderer with a similar API to Vue 3's h-function

Notifications You must be signed in to change notification settings

itsyjs/h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

h

install

pnpm add -D @itsy/h

use

import { h } from '@itsy/h'

h('h1', { class: 'omg' }, 'Hello world!')

api

The h function can take two or three primary arguments. In the three-argument form, an options-object is also available.

  • tag: The HTML tag to create
  • attrs: An object of HTML attributes - e.g. { id: 'foo' } would create id="foo"
  • children: A string or array of strings containing child-content for the parent
  • opts: An options-object
    • opts.escape: Will HTML-escape children

h(tag, attrs | children)

h(tag, attrs, children, opts?)

About

A node html-string renderer with a similar API to Vue 3's h-function

Resources

Stars

Watchers

Forks

Packages

No packages published