Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stagas/html-vdom
JSX virtual DOM using standard HTML.
https://github.com/stagas/html-vdom
html jsx vdom
Last synced: 5 days ago
JSON representation
JSX virtual DOM using standard HTML.
- Host: GitHub
- URL: https://github.com/stagas/html-vdom
- Owner: stagas
- License: mit
- Created: 2022-01-13T09:52:09.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-11T18:22:25.000Z (over 1 year ago)
- Last Synced: 2024-10-14T08:15:07.786Z (22 days ago)
- Topics: html, jsx, vdom
- Language: TypeScript
- Homepage:
- Size: 342 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
html-vdomJSX virtual DOM using standard HTML
npm i html-vdom
pnpm add html-vdom
yarn add html-vdom
## Examples
#
from-element
- #
view source
example/from-element.tsx
```tsx
/** @jsxImportSource html-vdom */
import { render } from 'html-vdom'
import { fromElement } from 'html-vdom/from-element'
class FooElement extends HTMLElement {
root = this.attachShadow({ mode: 'open' })
set who(name: string) {
this.root.innerHTML = 'Hello, ' + name
}
}
const Foo = fromElement(FooElement)
render(, document.body)
```
simple
- #
view source
example/simple.tsx
```tsx
/** @jsxImportSource html-vdom */
import { $, render } from 'html-vdom'
const App: $<{ who: string }> = ({ who }) =>
Hello, {who}!
render(, document.body)
```
with-hook
- #
view source
example/with-hook.tsx
```tsx
/** @jsxImportSource html-vdom */
import { $, Hook, hook, render } from 'html-vdom'
let greeting = 'Hello'
let update: Hook
const App: $<{ who: string }> = ({ who }) => {
update = hook
return
{greeting}, {who}!
}
render(, document.body)
setTimeout(() => {
greeting = 'Hiya'
update()
}, 500)
```
## API
# Chunk
# constructor
(arrayLength)
dom
= []
El []
firstChild
any
last
nextSibling
after
(x) # x
Node
after(x) =>
- void
appendChild
(x) # x
any
appendChild(x) =>
- void
remove
()
remove() =>
- void
removeChild
(x) # x
any
removeChild(x) =>
- void
save
()
save() =>
- void
DOMAttributes
# class
string
className
string
exportparts
string
hook
null
| VRef<unknown>
innerHTML
string
onhook
onref
# onunhook
# onunref
# part
string
style
null
| string | false
| void | Partial<CSSStyleDeclaration>
title
string
EventHandler
EventHandler(e) =>
- void
HTMLAttributes
# accesskey
string
aria-activedescendant
string
aria-atomic
boolean | "false"
| "true"
aria-autocomplete
"none"
| "list"
| "inline"
| "both"
aria-busy
boolean | "false"
| "true"
aria-checked
boolean | "false"
| "true"
| "mixed"
aria-colcount
number
aria-colindex
number
aria-colspan
number
aria-controls
string
aria-current
boolean | "false"
| "time"
| "true"
| "page"
| "step"
| "location"
| "date"
aria-describedby
string
aria-details
string
aria-disabled
boolean | "false"
| "true"
aria-dropeffect
"link"
| "none"
| "copy"
| "execute"
| "move"
| "popup"
aria-errormessage
string
aria-expanded
boolean | "false"
| "true"
aria-flowto
string
aria-grabbed
boolean | "false"
| "true"
aria-haspopup
boolean | "false"
| "dialog"
| "menu"
| "true"
| "grid"
| "listbox"
| "tree"
aria-hidden
boolean | "false"
| "true"
aria-invalid
boolean | "false"
| "true"
| "grammar"
| "spelling"
aria-keyshortcuts
string
aria-label
string
aria-labelledby
string
aria-level
number
aria-live
"off"
| "assertive"
| "polite"
aria-modal
boolean | "false"
| "true"
aria-multiline
boolean | "false"
| "true"
aria-multiselectable
boolean | "false"
| "true"
aria-orientation
"horizontal"
| "vertical"
aria-owns
string
aria-placeholder
string
aria-posinset
number
aria-pressed
boolean | "false"
| "true"
| "mixed"
aria-readonly
boolean | "false"
| "true"
aria-relevant
"text"
| "additions"
| "additions removals"
| "additions text"
| "all"
| "removals"
| "removals additions"
| "removals text"
| "text additions"
| "text removals"
aria-required
boolean | "false"
| "true"
aria-roledescription
string
aria-rowcount
number
aria-rowindex
number
aria-rowspan
number
aria-selected
boolean | "false"
| "true"
aria-setsize
number
aria-sort
"none"
| "ascending"
| "descending"
| "other"
aria-valuemax
number
aria-valuemin
number
aria-valuenow
number
aria-valuetext
string
autocapitalize
# autofocus
boolean
class
string
className
string
contenteditable
"false"
| "true"
contextmenu
string
dir
# draggable
"false"
| "true"
enterkeyhint
"search"
| "done"
| "enter"
| "go"
| "next"
| "previous"
| "send"
exportparts
string
hidden
boolean
hook
null
| VRef<unknown>
id
string
innerHTML
string
inputmode
"search"
| "text"
| "none"
| "tel"
| "url"
| "email"
| "numeric"
| "decimal"
is
string
itemid
string
itemprop
string
itemref
string | number | string | number []
itemscope
boolean
itemtype
string
lang
string
nonce
string
onabort
null
| false
| EventHandler<T, Event>
onanimationend
null
| false
| EventHandler<T, AnimationEvent>
onanimationiteration
null
| false
| EventHandler<T, AnimationEvent>
onanimationstart
null
| false
| EventHandler<T, AnimationEvent>
onblur
null
| false
| EventHandler<T, FocusEvent>
oncanplay
null
| false
| EventHandler<T, Event>
oncanplaythrough
null
| false
| EventHandler<T, Event>
onchange
null
| false
| EventHandler<T, Event>
onclick
null
| false
| EventHandler<T, MouseEvent>
oncompositionend
null
| false
| EventHandler<T, CompositionEvent>
oncompositionstart
null
| false
| EventHandler<T, CompositionEvent>
oncompositionupdate
null
| false
| EventHandler<T, CompositionEvent>
oncontextmenu
null
| false
| EventHandler<T, MouseEvent>
oncopy
null
| false
| EventHandler<T, ClipboardEvent>
oncut
null
| false
| EventHandler<T, ClipboardEvent>
ondblclick
null
| false
| EventHandler<T, MouseEvent>
ondrag
null
| false
| EventHandler<T, DragEvent>
ondragend
null
| false
| EventHandler<T, DragEvent>
ondragenter
null
| false
| EventHandler<T, DragEvent>
ondragexit
null
| false
| EventHandler<T, DragEvent>
ondragleave
null
| false
| EventHandler<T, DragEvent>
ondragover
null
| false
| EventHandler<T, DragEvent>
ondragstart
null
| false
| EventHandler<T, DragEvent>
ondrop
null
| false
| EventHandler<T, DragEvent>
ondurationchange
null
| false
| EventHandler<T, Event>
onemptied
null
| false
| EventHandler<T, Event>
onencrypted
null
| false
| EventHandler<T, Event>
onended
null
| false
| EventHandler<T, Event>
onerror
null
| false
| EventHandler<T, Event>
onfocus
null
| false
| EventHandler<T, FocusEvent>
ongotpointercapture
null
| false
| EventHandler<T, PointerEvent>
onhook
oninput
null
| false
| EventHandler<T, InputEvent>
onkeydown
null
| false
| EventHandler<T, KeyboardEvent>
onkeypress
null
| false
| EventHandler<T, KeyboardEvent>
onkeyup
null
| false
| EventHandler<T, KeyboardEvent>
onload
null
| false
| EventHandler<T, Event>
onloadeddata
null
| false
| EventHandler<T, Event>
onloadedmetadata
null
| false
| EventHandler<T, Event>
onloadstart
null
| false
| EventHandler<T, Event>
onlostpointercapture
null
| false
| EventHandler<T, PointerEvent>
onmousedown
null
| false
| EventHandler<T, MouseEvent>
onmouseenter
null
| false
| EventHandler<T, MouseEvent>
onmouseleave
null
| false
| EventHandler<T, MouseEvent>
onmousemove
null
| false
| EventHandler<T, MouseEvent>
onmouseout
null
| false
| EventHandler<T, MouseEvent>
onmouseover
null
| false
| EventHandler<T, MouseEvent>
onmouseup
null
| false
| EventHandler<T, MouseEvent>
onpaste
null
| false
| EventHandler<T, ClipboardEvent>
onpause
null
| false
| EventHandler<T, Event>
onplay
null
| false
| EventHandler<T, Event>
onplaying
null
| false
| EventHandler<T, Event>
onpointercancel
null
| false
| EventHandler<T, PointerEvent>
onpointerdown
null
| false
| EventHandler<T, PointerEvent>
onpointerenter
null
| false
| EventHandler<T, PointerEvent>
onpointerleave
null
| false
| EventHandler<T, PointerEvent>
onpointermove
null
| false
| EventHandler<T, PointerEvent>
onpointerout
null
| false
| EventHandler<T, PointerEvent>
onpointerover
null
| false
| EventHandler<T, PointerEvent>
onpointerup
null
| false
| EventHandler<T, PointerEvent>
onprogress
null
| false
| EventHandler<T, Event>
onratechange
null
| false
| EventHandler<T, Event>
onref
# onreset
null
| false
| EventHandler<T, Event>
onscroll
null
| false
| EventHandler<T, UIEvent>
onseeked
null
| false
| EventHandler<T, Event>
onseeking
null
| false
| EventHandler<T, Event>
onselect
null
| false
| EventHandler<T, UIEvent>
onstalled
null
| false
| EventHandler<T, Event>
onsubmit
null
| false
| EventHandler<T, Event & {
# submitter
HTMLElement
onsuspend
null
| false
| EventHandler<T, Event>
ontimeupdate
null
| false
| EventHandler<T, Event>
ontouchcancel
null
| false
| EventHandler<T, TouchEvent>
ontouchend
null
| false
| EventHandler<T, TouchEvent>
ontouchmove
null
| false
| EventHandler<T, TouchEvent>
ontouchstart
null
| false
| EventHandler<T, TouchEvent>
ontransitionend
null
| false
| EventHandler<T, TransitionEvent>
onunhook
# onunref
# onvolumechange
null
| false
| EventHandler<T, Event>
onwaiting
null
| false
| EventHandler<T, Event>
onwheel
null
| false
| EventHandler<T, WheelEvent>
part
string
role
# slot
string
spellcheck
"false"
| "true"
style
null
| string | false
| Partial<CSSStyleDeclaration> | StandardProperties<0
| string & {}, string & {}>
tabindex
string | number
title
string
translate
"false"
| "true"
xml:base
string
xml:lang
string
HTMLElements
# a
AHTMLAttributes<HTMLAnchorElement>
abbr
HTMLAttributes<HTMLElement>
acronym
HTMLAttributes<HTMLElement>
address
HTMLAttributes<HTMLElement>
applet
AppletHTMLAttributes<HTMLElement>
area
AreaHTMLAttributes<HTMLAreaElement>
article
HTMLAttributes<HTMLElement>
aside
HTMLAttributes<HTMLElement>
audio
AudioHTMLAttributes<HTMLAudioElement>
b
HTMLAttributes<HTMLElement>
base
BaseHTMLAttributes<HTMLBaseElement>
basefont
BasefontHTMLAttributes<HTMLElement>
bdi
HTMLAttributes<HTMLElement>
bdo
BdoHTMLAttributes<HTMLElement>
bgsound
BgsoundHTMLAttributes<HTMLElement>
big
HTMLAttributes<HTMLElement>
blink
HTMLAttributes<HTMLElement>
blockquote
BlockquoteHTMLAttributes<HTMLElement>
body
BodyHTMLAttributes<HTMLBodyElement>
br
BrHTMLAttributes<HTMLBRElement>
button
ButtonHTMLAttributes<HTMLButtonElement>
canvas
CanvasHTMLAttributes<HTMLCanvasElement>
caption
CaptionHTMLAttributes<HTMLElement>
center
HTMLAttributes<HTMLElement>
cite
HTMLAttributes<HTMLElement>
code
HTMLAttributes<HTMLElement>
col
ColHTMLAttributes<HTMLTableColElement>
colgroup
ColgroupHTMLAttributes<HTMLTableColElement>
content
ContentHTMLAttributes<HTMLElement>
data
DataHTMLAttributes<HTMLDataElement>
datalist
HTMLAttributes<HTMLElement>
dd
DdHTMLAttributes<HTMLElement>
del
DelHTMLAttributes<HTMLElement>
details
DetailsHTMLAttributes<HTMLDetailsElement>
dfn
HTMLAttributes<HTMLElement>
dialog
DialogHTMLAttributes<HTMLDialogElement>
dir
DirHTMLAttributes<HTMLElement>
div
HTMLAttributes<HTMLElement>
dl
HTMLAttributes<HTMLElement>
dt
HTMLAttributes<HTMLElement>
em
HTMLAttributes<HTMLElement>
embed
EmbedHTMLAttributes<HTMLEmbedElement>
fieldset
FieldsetHTMLAttributes<HTMLFieldSetElement>
figcaption
HTMLAttributes<HTMLElement>
figure
HTMLAttributes<HTMLElement>
font
FontHTMLAttributes<HTMLFontElement>
footer
HTMLAttributes<HTMLElement>
form
FormHTMLAttributes<HTMLFormElement>
frame
FrameHTMLAttributes<HTMLFrameElement>
frameset
FramesetHTMLAttributes<HTMLFrameSetElement>
h1
HTMLAttributes<HTMLElement>
h2
HTMLAttributes<HTMLElement>
h3
HTMLAttributes<HTMLElement>
h4
HTMLAttributes<HTMLElement>
h5
HTMLAttributes<HTMLElement>
head
HeadHTMLAttributes<HTMLHeadElement>
header
HTMLAttributes<HTMLElement>
hgroup
HTMLAttributes<HTMLElement>
hr
HrHTMLAttributes<HTMLHRElement>
html
HtmlHTMLAttributes<HTMLHtmlElement>
i
HTMLAttributes<HTMLElement>
iframe
IframeHTMLAttributes<HTMLIFrameElement>
img
ImgHTMLAttributes<HTMLImageElement>
input
InputHTMLAttributes<HTMLInputElement>
ins
InsHTMLAttributes<HTMLModElement>
isindex
HTMLAttributes<HTMLElement>
kbd
HTMLAttributes<HTMLElement>
keygen
KeygenHTMLAttributes<HTMLElement>
label
LabelHTMLAttributes<HTMLLabelElement>
legend
HTMLAttributes<HTMLElement>
li
LiHTMLAttributes<HTMLLIElement>
link
LinkHTMLAttributes<HTMLLinkElement>
listing
HTMLAttributes<HTMLElement>
main
HTMLAttributes<HTMLElement>
map
MapHTMLAttributes<HTMLMapElement>
mark
HTMLAttributes<HTMLElement>
marquee
MarqueeHTMLAttributes<HTMLMarqueeElement>
menu
HTMLAttributes<HTMLElement>
menuitem
MenuitemHTMLAttributes<HTMLElement>
meta
MetaHTMLAttributes<HTMLMetaElement>
meter
MeterHTMLAttributes<HTMLMeterElement>
multicol
HTMLAttributes<HTMLElement>
nav
HTMLAttributes<HTMLElement>
nextid
HTMLAttributes<HTMLElement>
nobr
HTMLAttributes<HTMLElement>
noembed
HTMLAttributes<HTMLElement>
noframes
HTMLAttributes<HTMLElement>
noscript
HTMLAttributes<HTMLElement>
object
ObjectHTMLAttributes<HTMLObjectElement>
ol
OlHTMLAttributes<HTMLOListElement>
optgroup
OptgroupHTMLAttributes<HTMLOptGroupElement>
option
OptionHTMLAttributes<HTMLOptionElement>
output
OutputHTMLAttributes<HTMLOutputElement>
p
HTMLAttributes<HTMLElement>
param
ParamHTMLAttributes<HTMLParamElement>
picture
HTMLAttributes<HTMLElement>
plaintext
HTMLAttributes<HTMLElement>
portal
PortalHTMLAttributes<HTMLElement>
pre
PreHTMLAttributes<HTMLPreElement>
progress
ProgressHTMLAttributes<HTMLProgressElement>
q
QHTMLAttributes<HTMLQuoteElement>
rb
HTMLAttributes<HTMLElement>
rp
HTMLAttributes<HTMLElement>
rt
HTMLAttributes<HTMLElement>
rtc
HTMLAttributes<HTMLElement>
ruby
HTMLAttributes<HTMLElement>
s
HTMLAttributes<HTMLElement>
samp
HTMLAttributes<HTMLElement>
script
ScriptHTMLAttributes<HTMLScriptElement>
section
HTMLAttributes<HTMLElement>
select
SelectHTMLAttributes<HTMLSelectElement>
shadow
HTMLAttributes<HTMLElement>
slot
SlotHTMLAttributes<HTMLSlotElement>
small
HTMLAttributes<HTMLElement>
source
SourceHTMLAttributes<HTMLSourceElement>
spacer
SpacerHTMLAttributes<HTMLElement>
span
HTMLAttributes<HTMLElement>
strike
HTMLAttributes<HTMLElement>
strong
HTMLAttributes<HTMLElement>
style
StyleHTMLAttributes<HTMLStyleElement>
sub
HTMLAttributes<HTMLElement>
summary
HTMLAttributes<HTMLElement>
sup
HTMLAttributes<HTMLElement>
table
TableHTMLAttributes<HTMLTableElement>
tbody
TbodyHTMLAttributes<HTMLTableSectionElement>
td
TdHTMLAttributes<HTMLTableDataCellElement>
template
HTMLAttributes<HTMLElement>
textarea
TextareaHTMLAttributes<HTMLTextAreaElement>
tfoot
TfootHTMLAttributes<HTMLTableSectionElement>
th
ThHTMLAttributes<HTMLTableHeaderCellElement>
thead
TheadHTMLAttributes<HTMLTableSectionElement>
time
TimeHTMLAttributes<HTMLTimeElement>
title
HTMLAttributes<HTMLElement>
tr
TrHTMLAttributes<HTMLTableRowElement>
track
TrackHTMLAttributes<HTMLTrackElement>
tt
HTMLAttributes<HTMLElement>
u
HTMLAttributes<HTMLElement>
ul
UlHTMLAttributes<HTMLUListElement>
var
HTMLAttributes<HTMLElement>
video
VideoHTMLAttributes<HTMLVideoElement>
wbr
HTMLAttributes<HTMLElement>
xmp
HTMLAttributes<HTMLElement>
IntrinsicElements
# a
AHTMLAttributes<HTMLAnchorElement>
abbr
HTMLAttributes<HTMLElement>
acronym
HTMLAttributes<HTMLElement>
address
HTMLAttributes<HTMLElement>
animate
AnimateSVGAttributes<SVGAnimateElement>
animateMotion
AnimateMotionSVGAttributes<SVGAnimateMotionElement>
animateTransform
AnimateTransformSVGAttributes<SVGAnimateTransformElement>
applet
AppletHTMLAttributes<HTMLElement>
area
AreaHTMLAttributes<HTMLAreaElement>
article
HTMLAttributes<HTMLElement>
aside
HTMLAttributes<HTMLElement>
audio
AudioHTMLAttributes<HTMLAudioElement>
b
HTMLAttributes<HTMLElement>
base
BaseHTMLAttributes<HTMLBaseElement>
basefont
BasefontHTMLAttributes<HTMLElement>
bdi
HTMLAttributes<HTMLElement>
bdo
BdoHTMLAttributes<HTMLElement>
bgsound
BgsoundHTMLAttributes<HTMLElement>
big
HTMLAttributes<HTMLElement>
blink
HTMLAttributes<HTMLElement>
blockquote
BlockquoteHTMLAttributes<HTMLElement>
body
BodyHTMLAttributes<HTMLBodyElement>
br
BrHTMLAttributes<HTMLBRElement>
button
ButtonHTMLAttributes<HTMLButtonElement>
canvas
CanvasHTMLAttributes<HTMLCanvasElement>
caption
CaptionHTMLAttributes<HTMLElement>
center
HTMLAttributes<HTMLElement>
circle
CircleSVGAttributes<SVGCircleElement>
cite
HTMLAttributes<HTMLElement>
clipPath
ClipPathSVGAttributes<SVGClipPathElement>
code
HTMLAttributes<HTMLElement>
col
ColHTMLAttributes<HTMLTableColElement>
colgroup
ColgroupHTMLAttributes<HTMLTableColElement>
content
ContentHTMLAttributes<HTMLElement>
data
DataHTMLAttributes<HTMLDataElement>
datalist
HTMLAttributes<HTMLElement>
dd
DdHTMLAttributes<HTMLElement>
defs
DefsSVGAttributes<SVGDefsElement>
del
DelHTMLAttributes<HTMLElement>
desc
DescSVGAttributes<SVGDescElement>
details
DetailsHTMLAttributes<HTMLDetailsElement>
dfn
HTMLAttributes<HTMLElement>
dialog
DialogHTMLAttributes<HTMLDialogElement>
dir
DirHTMLAttributes<HTMLElement>
div
HTMLAttributes<HTMLElement>
dl
HTMLAttributes<HTMLElement>
dt
HTMLAttributes<HTMLElement>
ellipse
EllipseSVGAttributes<SVGEllipseElement>
em
HTMLAttributes<HTMLElement>
embed
EmbedHTMLAttributes<HTMLEmbedElement>
feBlend
FeBlendSVGAttributes<SVGFEBlendElement>
feColorMatrix
FeColorMatrixSVGAttributes<SVGFEColorMatrixElement>
feComponentTransfer
FeComponentTransferSVGAttributes<SVGFEComponentTransferElement>
feComposite
FeCompositeSVGAttributes<SVGFECompositeElement>
feConvolveMatrix
FeConvolveMatrixSVGAttributes<SVGFEConvolveMatrixElement>
feDiffuseLighting
FeDiffuseLightingSVGAttributes<SVGFEDiffuseLightingElement>
feDisplacementMap
FeDisplacementMapSVGAttributes<SVGFEDisplacementMapElement>
feDistantLight
FeDistantLightSVGAttributes<SVGFEDistantLightElement>
feFlood
FeFloodSVGAttributes<SVGFEFloodElement>
feFuncA
FeFuncSVGAttributes<SVGFEFuncAElement>
feFuncB
FeFuncSVGAttributes<SVGFEFuncBElement>
feFuncG
FeFuncSVGAttributes<SVGFEFuncGElement>
feFuncR
FeFuncSVGAttributes<SVGFEFuncRElement>
feGaussianBlur
FeGaussianBlurSVGAttributes<SVGFEGaussianBlurElement>
feImage
FeImageSVGAttributes<SVGFEImageElement>
feMerge
FeMergeSVGAttributes<SVGFEMergeElement>
feMergeNode
FeMergeNodeSVGAttributes<SVGFEMergeNodeElement>
feMorphology
FeMorphologySVGAttributes<SVGFEMorphologyElement>
feOffset
FeOffsetSVGAttributes<SVGFEOffsetElement>
fePointLight
FePointLightSVGAttributes<SVGFEPointLightElement>
feSpecularLighting
FeSpecularLightingSVGAttributes<SVGFESpecularLightingElement>
feSpotLight
FeSpotLightSVGAttributes<SVGFESpotLightElement>
feTile
FeTileSVGAttributes<SVGFETileElement>
feTurbulence
FeTurbulanceSVGAttributes<SVGFETurbulenceElement>
fieldset
FieldsetHTMLAttributes<HTMLFieldSetElement>
figcaption
HTMLAttributes<HTMLElement>
figure
HTMLAttributes<HTMLElement>
filter
FilterSVGAttributes<SVGFilterElement>
font
FontHTMLAttributes<HTMLFontElement>
footer
HTMLAttributes<HTMLElement>
foreignObject
ForeignObjectSVGAttributes<SVGForeignObjectElement>
form
FormHTMLAttributes<HTMLFormElement>
frame
FrameHTMLAttributes<HTMLFrameElement>
frameset
FramesetHTMLAttributes<HTMLFrameSetElement>
g
GSVGAttributes<SVGGElement>
h1
HTMLAttributes<HTMLElement>
h2
HTMLAttributes<HTMLElement>
h3
HTMLAttributes<HTMLElement>
h4
HTMLAttributes<HTMLElement>
h5
HTMLAttributes<HTMLElement>
head
HeadHTMLAttributes<HTMLHeadElement>
header
HTMLAttributes<HTMLElement>
hgroup
HTMLAttributes<HTMLElement>
hr
HrHTMLAttributes<HTMLHRElement>
html
HtmlHTMLAttributes<HTMLHtmlElement>
i
HTMLAttributes<HTMLElement>
iframe
IframeHTMLAttributes<HTMLIFrameElement>
image
ImageSVGAttributes<SVGImageElement>
img
ImgHTMLAttributes<HTMLImageElement>
input
InputHTMLAttributes<HTMLInputElement>
ins
InsHTMLAttributes<HTMLModElement>
isindex
HTMLAttributes<HTMLElement>
kbd
HTMLAttributes<HTMLElement>
keygen
KeygenHTMLAttributes<HTMLElement>
label
LabelHTMLAttributes<HTMLLabelElement>
legend
HTMLAttributes<HTMLElement>
li
LiHTMLAttributes<HTMLLIElement>
line
LineSVGAttributes<SVGLineElement>
linearGradient
LinearGradientSVGAttributes<SVGLinearGradientElement>
link
LinkHTMLAttributes<HTMLLinkElement>
listing
HTMLAttributes<HTMLElement>
main
HTMLAttributes<HTMLElement>
map
MapHTMLAttributes<HTMLMapElement>
mark
HTMLAttributes<HTMLElement>
marker
MarkerSVGAttributes<SVGMarkerElement>
marquee
MarqueeHTMLAttributes<HTMLMarqueeElement>
mask
MaskSVGAttributes<SVGMaskElement>
menu
HTMLAttributes<HTMLElement>
menuitem
MenuitemHTMLAttributes<HTMLElement>
meta
MetaHTMLAttributes<HTMLMetaElement>
metadata
MetadataSVGAttributes<SVGMetadataElement>
meter
MeterHTMLAttributes<HTMLMeterElement>
multicol
HTMLAttributes<HTMLElement>
nav
HTMLAttributes<HTMLElement>
nextid
HTMLAttributes<HTMLElement>
nobr
HTMLAttributes<HTMLElement>
noembed
HTMLAttributes<HTMLElement>
noframes
HTMLAttributes<HTMLElement>
noscript
HTMLAttributes<HTMLElement>
object
ObjectHTMLAttributes<HTMLObjectElement>
ol
OlHTMLAttributes<HTMLOListElement>
optgroup
OptgroupHTMLAttributes<HTMLOptGroupElement>
option
OptionHTMLAttributes<HTMLOptionElement>
output
OutputHTMLAttributes<HTMLOutputElement>
p
HTMLAttributes<HTMLElement>
param
ParamHTMLAttributes<HTMLParamElement>
path
PathSVGAttributes<SVGPathElement>
pattern
PatternSVGAttributes<SVGPatternElement>
picture
HTMLAttributes<HTMLElement>
plaintext
HTMLAttributes<HTMLElement>
polygon
PolygonSVGAttributes<SVGPolygonElement>
polyline
PolylineSVGAttributes<SVGPolylineElement>
portal
PortalHTMLAttributes<HTMLElement>
pre
PreHTMLAttributes<HTMLPreElement>
progress
ProgressHTMLAttributes<HTMLProgressElement>
q
QHTMLAttributes<HTMLQuoteElement>
radialGradient
RadialGradientSVGAttributes<SVGRadialGradientElement>
rb
HTMLAttributes<HTMLElement>
rect
RectSVGAttributes<SVGRectElement>
rp
HTMLAttributes<HTMLElement>
rt
HTMLAttributes<HTMLElement>
rtc
HTMLAttributes<HTMLElement>
ruby
HTMLAttributes<HTMLElement>
s
HTMLAttributes<HTMLElement>
samp
HTMLAttributes<HTMLElement>
script
ScriptHTMLAttributes<HTMLScriptElement>
section
HTMLAttributes<HTMLElement>
select
SelectHTMLAttributes<HTMLSelectElement>
shadow
HTMLAttributes<HTMLElement>
slot
SlotHTMLAttributes<HTMLSlotElement>
small
HTMLAttributes<HTMLElement>
source
SourceHTMLAttributes<HTMLSourceElement>
spacer
SpacerHTMLAttributes<HTMLElement>
span
HTMLAttributes<HTMLElement>
stop
StopSVGAttributes<SVGStopElement>
strike
HTMLAttributes<HTMLElement>
strong
HTMLAttributes<HTMLElement>
style
StyleHTMLAttributes<HTMLStyleElement>
sub
HTMLAttributes<HTMLElement>
summary
HTMLAttributes<HTMLElement>
sup
HTMLAttributes<HTMLElement>
svg
SvgSVGAttributes<SVGSVGElement>
switch
SwitchSVGAttributes<SVGSwitchElement>
symbol
SymbolSVGAttributes<SVGSymbolElement>
table
TableHTMLAttributes<HTMLTableElement>
tbody
TbodyHTMLAttributes<HTMLTableSectionElement>
td
TdHTMLAttributes<HTMLTableDataCellElement>
template
HTMLAttributes<HTMLElement>
text
TextSVGAttributes<SVGTextElement>
textPath
TextPathSVGAttributes<SVGTextPathElement>
textarea
TextareaHTMLAttributes<HTMLTextAreaElement>
tfoot
TfootHTMLAttributes<HTMLTableSectionElement>
th
ThHTMLAttributes<HTMLTableHeaderCellElement>
thead
TheadHTMLAttributes<HTMLTableSectionElement>
time
TimeHTMLAttributes<HTMLTimeElement>
title
HTMLAttributes<HTMLElement>
tr
TrHTMLAttributes<HTMLTableRowElement>
track
TrackHTMLAttributes<HTMLTrackElement>
tspan
TSpanSVGAttributes<SVGTSpanElement>
tt
HTMLAttributes<HTMLElement>
u
HTMLAttributes<HTMLElement>
ul
UlHTMLAttributes<HTMLUListElement>
use
UseSVGAttributes<SVGUseElement>
var
HTMLAttributes<HTMLElement>
video
VideoHTMLAttributes<HTMLVideoElement>
view
ViewSVGAttributes<SVGViewElement>
wbr
HTMLAttributes<HTMLElement>
xmp
HTMLAttributes<HTMLElement>
SVGAttributes
# class
string
className
string
exportparts
string
hook
null
| VRef<unknown>
id
string
innerHTML
string
lang
string
onabort
null
| false
| EventHandler<T, Event>
onanimationend
null
| false
| EventHandler<T, AnimationEvent>
onanimationiteration
null
| false
| EventHandler<T, AnimationEvent>
onanimationstart
null
| false
| EventHandler<T, AnimationEvent>
onblur
null
| false
| EventHandler<T, FocusEvent>
oncanplay
null
| false
| EventHandler<T, Event>
oncanplaythrough
null
| false
| EventHandler<T, Event>
onchange
null
| false
| EventHandler<T, Event>
onclick
null
| false
| EventHandler<T, MouseEvent>
oncompositionend
null
| false
| EventHandler<T, CompositionEvent>
oncompositionstart
null
| false
| EventHandler<T, CompositionEvent>
oncompositionupdate
null
| false
| EventHandler<T, CompositionEvent>
oncontextmenu
null
| false
| EventHandler<T, MouseEvent>
oncopy
null
| false
| EventHandler<T, ClipboardEvent>
oncut
null
| false
| EventHandler<T, ClipboardEvent>
ondblclick
null
| false
| EventHandler<T, MouseEvent>
ondrag
null
| false
| EventHandler<T, DragEvent>
ondragend
null
| false
| EventHandler<T, DragEvent>
ondragenter
null
| false
| EventHandler<T, DragEvent>
ondragexit
null
| false
| EventHandler<T, DragEvent>
ondragleave
null
| false
| EventHandler<T, DragEvent>
ondragover
null
| false
| EventHandler<T, DragEvent>
ondragstart
null
| false
| EventHandler<T, DragEvent>
ondrop
null
| false
| EventHandler<T, DragEvent>
ondurationchange
null
| false
| EventHandler<T, Event>
onemptied
null
| false
| EventHandler<T, Event>
onencrypted
null
| false
| EventHandler<T, Event>
onended
null
| false
| EventHandler<T, Event>
onerror
null
| false
| EventHandler<T, Event>
onfocus
null
| false
| EventHandler<T, FocusEvent>
ongotpointercapture
null
| false
| EventHandler<T, PointerEvent>
onhook
oninput
null
| false
| EventHandler<T, InputEvent>
onkeydown
null
| false
| EventHandler<T, KeyboardEvent>
onkeypress
null
| false
| EventHandler<T, KeyboardEvent>
onkeyup
null
| false
| EventHandler<T, KeyboardEvent>
onload
null
| false
| EventHandler<T, Event>
onloadeddata
null
| false
| EventHandler<T, Event>
onloadedmetadata
null
| false
| EventHandler<T, Event>
onloadstart
null
| false
| EventHandler<T, Event>
onlostpointercapture
null
| false
| EventHandler<T, PointerEvent>
onmousedown
null
| false
| EventHandler<T, MouseEvent>
onmouseenter
null
| false
| EventHandler<T, MouseEvent>
onmouseleave
null
| false
| EventHandler<T, MouseEvent>
onmousemove
null
| false
| EventHandler<T, MouseEvent>
onmouseout
null
| false
| EventHandler<T, MouseEvent>
onmouseover
null
| false
| EventHandler<T, MouseEvent>
onmouseup
null
| false
| EventHandler<T, MouseEvent>
onpaste
null
| false
| EventHandler<T, ClipboardEvent>
onpause
null
| false
| EventHandler<T, Event>
onplay
null
| false
| EventHandler<T, Event>
onplaying
null
| false
| EventHandler<T, Event>
onpointercancel
null
| false
| EventHandler<T, PointerEvent>
onpointerdown
null
| false
| EventHandler<T, PointerEvent>
onpointerenter
null
| false
| EventHandler<T, PointerEvent>
onpointerleave
null
| false
| EventHandler<T, PointerEvent>
onpointermove
null
| false
| EventHandler<T, PointerEvent>
onpointerout
null
| false
| EventHandler<T, PointerEvent>
onpointerover
null
| false
| EventHandler<T, PointerEvent>
onpointerup
null
| false
| EventHandler<T, PointerEvent>
onprogress
null
| false
| EventHandler<T, Event>
onratechange
null
| false
| EventHandler<T, Event>
onref
# onreset
null
| false
| EventHandler<T, Event>
onscroll
null
| false
| EventHandler<T, UIEvent>
onseeked
null
| false
| EventHandler<T, Event>
onseeking
null
| false
| EventHandler<T, Event>
onselect
null
| false
| EventHandler<T, UIEvent>
onstalled
null
| false
| EventHandler<T, Event>
onsubmit
null
| false
| EventHandler<T, Event & {
# submitter
HTMLElement
onsuspend
null
| false
| EventHandler<T, Event>
ontimeupdate
null
| false
| EventHandler<T, Event>
ontouchcancel
null
| false
| EventHandler<T, TouchEvent>
ontouchend
null
| false
| EventHandler<T, TouchEvent>
ontouchmove
null
| false
| EventHandler<T, TouchEvent>
ontouchstart
null
| false
| EventHandler<T, TouchEvent>
ontransitionend
null
| false
| EventHandler<T, TransitionEvent>
onunhook
# onunref
# onvolumechange
null
| false
| EventHandler<T, Event>
onwaiting
null
| false
| EventHandler<T, Event>
onwheel
null
| false
| EventHandler<T, WheelEvent>
part
string
style
null
| string | false
| void | Partial<CSSStyleDeclaration>
tabindex
string | number
title
string
SVGElements
# animate
AnimateSVGAttributes<SVGAnimateElement>
animateMotion
AnimateMotionSVGAttributes<SVGAnimateMotionElement>
animateTransform
AnimateTransformSVGAttributes<SVGAnimateTransformElement>
circle
CircleSVGAttributes<SVGCircleElement>
clipPath
ClipPathSVGAttributes<SVGClipPathElement>
defs
DefsSVGAttributes<SVGDefsElement>
desc
DescSVGAttributes<SVGDescElement>
ellipse
EllipseSVGAttributes<SVGEllipseElement>
feBlend
FeBlendSVGAttributes<SVGFEBlendElement>
feColorMatrix
FeColorMatrixSVGAttributes<SVGFEColorMatrixElement>
feComponentTransfer
FeComponentTransferSVGAttributes<SVGFEComponentTransferElement>
feComposite
FeCompositeSVGAttributes<SVGFECompositeElement>
feConvolveMatrix
FeConvolveMatrixSVGAttributes<SVGFEConvolveMatrixElement>
feDiffuseLighting
FeDiffuseLightingSVGAttributes<SVGFEDiffuseLightingElement>
feDisplacementMap
FeDisplacementMapSVGAttributes<SVGFEDisplacementMapElement>
feDistantLight
FeDistantLightSVGAttributes<SVGFEDistantLightElement>
feFlood
FeFloodSVGAttributes<SVGFEFloodElement>
feFuncA
FeFuncSVGAttributes<SVGFEFuncAElement>
feFuncB
FeFuncSVGAttributes<SVGFEFuncBElement>
feFuncG
FeFuncSVGAttributes<SVGFEFuncGElement>
feFuncR
FeFuncSVGAttributes<SVGFEFuncRElement>
feGaussianBlur
FeGaussianBlurSVGAttributes<SVGFEGaussianBlurElement>
feImage
FeImageSVGAttributes<SVGFEImageElement>
feMerge
FeMergeSVGAttributes<SVGFEMergeElement>
feMergeNode
FeMergeNodeSVGAttributes<SVGFEMergeNodeElement>
feMorphology
FeMorphologySVGAttributes<SVGFEMorphologyElement>
feOffset
FeOffsetSVGAttributes<SVGFEOffsetElement>
fePointLight
FePointLightSVGAttributes<SVGFEPointLightElement>
feSpecularLighting
FeSpecularLightingSVGAttributes<SVGFESpecularLightingElement>
feSpotLight
FeSpotLightSVGAttributes<SVGFESpotLightElement>
feTile
FeTileSVGAttributes<SVGFETileElement>
feTurbulence
FeTurbulanceSVGAttributes<SVGFETurbulenceElement>
filter
FilterSVGAttributes<SVGFilterElement>
foreignObject
ForeignObjectSVGAttributes<SVGForeignObjectElement>
g
GSVGAttributes<SVGGElement>
image
ImageSVGAttributes<SVGImageElement>
line
LineSVGAttributes<SVGLineElement>
linearGradient
LinearGradientSVGAttributes<SVGLinearGradientElement>
marker
MarkerSVGAttributes<SVGMarkerElement>
mask
MaskSVGAttributes<SVGMaskElement>
metadata
MetadataSVGAttributes<SVGMetadataElement>
path
PathSVGAttributes<SVGPathElement>
pattern
PatternSVGAttributes<SVGPatternElement>
polygon
PolygonSVGAttributes<SVGPolygonElement>
polyline
PolylineSVGAttributes<SVGPolylineElement>
radialGradient
RadialGradientSVGAttributes<SVGRadialGradientElement>
rect
RectSVGAttributes<SVGRectElement>
stop
StopSVGAttributes<SVGStopElement>
svg
SvgSVGAttributes<SVGSVGElement>
switch
SwitchSVGAttributes<SVGSwitchElement>
symbol
SymbolSVGAttributes<SVGSymbolElement>
text
TextSVGAttributes<SVGTextElement>
textPath
TextPathSVGAttributes<SVGTextPathElement>
tspan
TSpanSVGAttributes<SVGTSpanElement>
use
UseSVGAttributes<SVGUseElement>
view
ViewSVGAttributes<SVGViewElement>
VRef
# $
# Doc
# HTMLAutocapitalize
"off"
| "none"
| "on"
| "sentences"
| "words"
| "characters"
HTMLAutocomplete
"additional-name"
| "address-level1"
| "address-level2"
| "address-level3"
| "address-level4"
| "address-line1"
| "address-line2"
| "address-line3"
| "bday"
| "bday-year"
| "bday-day"
| "bday-month"
| "billing"
| "cc-additional-name"
| "cc-csc"
| "cc-exp"
| "cc-exp-month"
| "cc-exp-year"
| "cc-family-name"
| "cc-given-name"
| "cc-name"
| "cc-number"
| "cc-type"
| "country"
| "country-name"
| "current-password"
| "email"
| "family-name"
| "fax"
| "given-name"
| "home"
| "honorific-prefix"
| "honorific-suffix"
| "impp"
| "language"
| "mobile"
| "name"
| "new-password"
| "nickname"
| "organization"
| "organization-title"
| "pager"
| "photo"
| "postal-code"
| "sex"
| "shipping"
| "street-address"
| "tel-area-code"
| "tel"
| "tel-country-code"
| "tel-extension"
| "tel-local"
| "tel-local-prefix"
| "tel-local-suffix"
| "tel-national"
| "transaction-amount"
| "transaction-currency"
| "url"
| "username"
| "work"
HTMLCrossorigin
"anonymous"
| "use-credentials"
| ""
HTMLDir
"ltr"
| "rtl"
| "auto"
HTMLFormEncType
"application/x-www-form-urlencoded"
| "multipart/form-data"
| "text/plain"
HTMLFormMethod
"post"
| "get"
| "dialog"
HTMLIframeSandbox
"allow-downloads-without-user-activation"
| "allow-forms"
| "allow-modals"
| "allow-orientation-lock"
| "allow-pointer-lock"
| "allow-popups"
| "allow-popups-to-escape-sandbox"
| "allow-presentation"
| "allow-same-origin"
| "allow-scripts"
| "allow-storage-access-by-user-activation"
| "allow-top-navigation"
| "allow-top-navigation-by-user-activation"
HTMLLinkAs
"audio"
| "document"
| "embed"
| "fetch"
| "font"
| "image"
| "object"
| "script"
| "style"
| "track"
| "video"
| "worker"
HTMLReferrerPolicy
"no-referrer"
| "no-referrer-when-downgrade"
| "origin"
| "origin-when-cross-origin"
| "same-origin"
| "strict-origin"
| "strict-origin-when-cross-origin"
| "unsafe-url"
HTMLRole
"alert"
| "alertdialog"
| "application"
| "article"
| "banner"
| "blockquote"
| "button"
| "caption"
| "cell"
| "checkbox"
| "code"
| "columnheader"
| "combobox"
| "command"
| "complementary"
| "composite"
| "contentinfo"
| "definition"
| "deletion"
| "dialog"
| "directory"
| "document"
| "emphasis"
| "feed"
| "figure"
| "form"
| "generic"
| "grid"
| "gridcell"
| "group"
| "heading"
| "img"
| "input"
| "insertion"
| "landmark"
| "link"
| "list"
| "listbox"
| "listitem"
| "log"
| "main"
| "marquee"
| "math"
| "menu"
| "menubar"
| "menuitem"
| "menuitemcheckbox"
| "menuitemradio"
| "meter"
| "navigation"
| "none"
| "note"
| "option"
| "paragraph"
| "presentation"
| "progressbar"
| "radio"
| "radiogroup"
| "range"
| "region"
| "roletype"
| "row"
| "rowgroup"
| "rowheader"
| "scrollbar"
| "search"
| "searchbox"
| "section"
| "sectionhead"
| "select"
| "separator"
| "slider"
| "spinbutton"
| "status"
| "strong"
| "structure"
| "subscript"
| "superscript"
| "switch"
| "tab"
| "table"
| "tablist"
| "tabpanel"
| "term"
| "textbox"
| "time"
| "timer"
| "toolbar"
| "tooltip"
| "tree"
| "treegrid"
| "treeitem"
| "widget"
| "window"
Hook
# remove
# ()
() =>
- void
start
# ()
() =>
- void
Props
Record<string, any>
VFn
# VKid
VKids | VNode<any> | string | number | boolean | null
| undefined | void
VNode
# onunref
# ()
() =>
- void
props
} # Fragment
= ...
typeof Fragment
renderCache
= ...
WeakMap<object, any>
createHook
()
createHook() =>
Hook<{}>
createProps
(doc, el, type, props, attrs, cacheRef) # doc
el
Element
type
string
props
= {}
# attrs
= {}
Record<string, Attr>
cacheRef
= el
object
createProps(doc, el, type, props, attrs, cacheRef) =>
- void
hook
(args) # args
any
hook(args) =>
- any
html
(tagName, options) # tagName
options
ElementCreationOptions
html<K>(tagName, options) =>
HTMLElementTagNameMap [K]
tagName
#
options
ElementCreationOptions
html<K>(tagName, options) =>
HTMLElementDeprecatedTagNameMap [K]
tagName
string
#
options
ElementCreationOptions
html(tagName, options) =>
- HTMLElement
jsx
(kind, props, key) # jsxs
(kind, props, key) # render
(n) # n
render(n) =>
- DocumentFragment
n
#
el
#
doc
#
withNull
boolean
render<T extends TargetEl>(n, el, doc, withNull) =>
svg
(args) # args
[ named-tuple-member, named-tuple-member ]
svg(args) =>
- Element
updateProps
(doc, el, type, next, cacheRef) # doc
el
Element
type
string
next
= {}
# cacheRef
= el
object
updateProps(doc, el, type, next, cacheRef) =>
- void
## Credits
- [event-toolkit](https://npmjs.org/package/event-toolkit) by [stagas](https://github.com/stagas) – Toolkit for DOM events.
- [everyday-types](https://npmjs.org/package/everyday-types) by [stagas](https://github.com/stagas) – Everyday utility types
- [everyday-utils](https://npmjs.org/package/everyday-utils) by [stagas](https://github.com/stagas) – Everyday utilities
- [html-jsx](https://npmjs.org/package/html-jsx) by [stagas](https://github.com/stagas) – Extensible jsx type definitions for standard html interfaces.
## Contributing
[Fork](https://github.com/stagas/html-vdom/fork) or [edit](https://github.dev/stagas/html-vdom) and submit a PR.
All contributions are welcome!
## License
MIT © 2023 [stagas](https://github.com/stagas)