Element

Layout

Takes a block

A custom element a script defines, placed by its tag: Element("stripe-pricing-table", publishable-key: key) { on ready { … } }. Every named argument is an attribute, every on handler an event it fires, and the block its children.

Element(tag) { … }

Example

Element("relative-time", datetime: "2026-03-14T09:30:00Z") { Text("March 14") } Element("stripe-pricing-table", publishableKey: "pk_test_…") { on ready { log("prices shown") } }
Props of Element
Prop Type Meaning
tag String (positional)

The custom element's tag: lower case, with a hyphen, as every custom element's is

Attribute families: any. Plus the universal props on every element: animate:, exit:, speed:, class:, ref:.