Element Functions
Every HTML element is a typed function.
Signature
Section titled “Signature”function div(props?: CommonProps | Child, ...children: Child[]): WhisqNodefunction span(props?: CommonProps | Child, ...children: Child[]): WhisqNodefunction button(props?: ButtonProps | Child, ...children: Child[]): WhisqNodefunction input(props?: InputProps): WhisqNode// ... and 30+ moreTwo Call Signatures
Section titled “Two Call Signatures”// With props + childrendiv({ class: "card", id: "main" }, h1("Title"), p("Content"))
// Without props — just childrendiv(h1("Title"), p("Content"))
// Single text childh1("Hello Whisq")Available Elements
Section titled “Available Elements”Layout: div, span, main, section, article, aside, header, footer, nav
Text: h1–h6, p, strong, em, small, pre, code
Interactive: button, a
Forms: form, input, textarea, select, option, label
Lists: ul, ol, li
Table: table, thead, tbody, tr, th, td
Media: img, video, audio
Misc: br, hr, iframe
Reactive Props
Section titled “Reactive Props”div({ class: () => active.value ? "on" : "off" })div({ style: () => `color: ${color.value}` })div({ hidden: () => !visible.value })Events
Section titled “Events”button({ onclick: () => count.value++ }, "Click")input({ oninput: (e) => name.value = e.target.value })