HTML and SVG tag reference
Calling a tag
Section titled “Calling a tag”import { div, img, p } from "min-reactive-framework/html";import { circle, svg } from "min-reactive-framework/svg";
const node: HTMLDivElement = div({ id: "card" }, p("Hello"));const image: HTMLImageElement = img({ src: "./photo.png", alt: "A sample" });const icon: SVGSVGElement = svg({ viewBox: "0 0 24 24" }, circle({ cx: 12, cy: 12, r: 8 }));Normal tags accept tag(...children) or tag(options, ...children) and return their native DOM type. Void HTML tags take options only. The children of template() go into its .content. HTML script() and style() accept literal text.
Options
Section titled “Options”| Option | Contract |
|---|---|
| Standard HTML attributes | Use HTML spelling, such as for, readonly, or tabindex. Tag-specific options have corresponding types. |
attrs |
Extra attributes. If the same name is also set at the top level, the top-level option wins. |
data-* and aria-* |
Browser attributes. Boolean values are written as text, so "aria-expanded": false writes "false". |
| Boolean HTML attributes | A true value adds the attribute, false removes it. A nullish binding removes its attribute. |
class |
A class string or a per-token boolean map. |
style |
A map of CSS property names, including custom properties, to string values. |
on |
Native handler (event, element) => void or { handler, options }. |
| Form values | value and checked use DOM properties on the controls that support them. See forms. |
Attributes and style values accept signals and pure read functions where applicable. Create those bindings inside a mount or a child lifetime. For CSS recipes, see CSS and SVG.
HTML exports
Section titled “HTML exports”Import from min-reactive-framework/html. Use varTag for <var>. Standalone ESM and classic scripts expose the same builders in dist/html.js and MiniReactive.html.
No matching tags.
aabbraddressareaarticleasideaudiobbasebdibdoblockquotebodybrbuttoncanvascaptioncitecodecolcolgroupdatadatalistdddeldetailsdfndialogdivdldtemembedfieldsetfigcaptionfigurefooterformh1h2h3h4h5h6headheaderhgrouphrhtmliiframeimginputinskbdlabellegendlilinkmainmapmarkmenumetameternavnoscriptobjectoloptgroupoptionoutputppicturepreprogressqrprtrubyssampscriptsearchsectionselectselectedcontentslotsmallsourcespanstrongstylesubsummarysuptabletbodytdtemplatetextareatfootththeadtimetitletrtrackuulvarTag<var>videowbr
SVG exports
Section titled “SVG exports”Import from min-reactive-framework/svg, or use MiniReactive.svg in a classic script. Use switchTag for SVG <switch>. SVG attributes preserve their spelling, and attrs accepts attributes such as xlink:href.
No matching tags.
aanimateanimateMotionanimateTransformcircleclipPathdefsdescellipsefeBlendfeColorMatrixfeComponentTransferfeCompositefeConvolveMatrixfeDiffuseLightingfeDisplacementMapfeDistantLightfeDropShadowfeFloodfeFuncAfeFuncBfeFuncGfeFuncRfeGaussianBlurfeImagefeMergefeMergeNodefeMorphologyfeOffsetfePointLightfeSpecularLightingfeSpotLightfeTilefeTurbulencefilterforeignObjectgimagelinelinearGradientmarkermaskmetadatampathpathpatternpolygonpolylineradialGradientrectscriptsetstopstylesvgswitchTag<switch>symboltexttextPathtitletspanuseview