Static
elementStatic
htmlStatic
svgStatic
textStatic
divStatic
spanStatic
flexConvenience function that creates a div
with the CSS property display: flex
.
The given type is used to set flex-direction
accordingly and set width: 100%
in case of row
.
If no type is specified, row
is assumed.
Optional
type: "row" | "column"Like Tag.flex:DIV but creates a span
with the CSS property display: inline-flex
(and omits the width
property).
Static
gridConvenience function that creates a div
with the CSS property display: grid
.
Static
cellStatic
hStatic
pOptional
text: anyStatic
imgOptional
url: anyOptional
title: anyStatic
linkOptional
url: MaybeReactive<string>Static
buttonStatic
formStatic
inputCreates an InputTag of type number
.
Creates an InputTag of type checkbox
.
Like Tag.input:CHECK_SINGLE but allows selecting multiple checkboxes bound to a single array or Set.
To specify the value that should be added to the array or set when a specific input is checked, ElementTag.withValue needs to be called on each of them. You can do this manually, but we encourage you to use InputTag.bindValue:OPTION instead, which does this for you and provides better type checking.
Creates an InputTag of type radio
.
You usually need to create a radio input for each option and bind them to a single value. To specify the value to use when an input is selected, ElementTag.withValue needs to be called on each of them. You can do this manually, but we encourage you to use InputTag.bindValue:OPTION instead, which does this for you and provides better type checking.
Creates an InputTag of given date/time type.
Like Tag.input:DATE but allows specifying parse and format functions to convert between the strings used by the input element and a custom representation of your choice.
Creates an InputTag of type select
.
You can specify the options either as an argument to this method, or by manually adding children to the returned tag. In the latter case, you need to call ElementTag.withValue on each option to specify the value that should be used when it is selected.
Like Tag.input:SELECT_SINGLE but for type multiselect
. The bound value should be an array or a Set in this case.
Creates an InputTag of the given type.
Static
labelOptional
text: anyStatic
parseParse the given HTML fragment.
HTML code
how to parse and sanitize the source - always thoroughly sanitize untrusted code (i.e. any potential user input, including request parameters, local storage etc...)!
Static
parseParse the given SVG code.
SVG code
how to parse and sanitize the source - always thoroughly sanitize untrusted code (i.e. any potential user input, including request parameters, local storage etc...)!
Registers the given event handler on this element.
Be aware that Event.preventDefault is called for you, since this is almost always desirable. If ever you need to allow default handling, just return ALLOW_DEFAULT from the handler.
Optional
options: AddEventListenerOptionsLike Tag.on:STRING but allows correct Event type checking in the handler for standard events.
Optional
options: AddEventListenerOptionsLike Tag.on:STRING but identifies the event by its class instead of the conventional type string. This allows strong type checking in the handler even with custom events. It works by deferring the actual registration until an event is fired, at which time the type string can be determined from the event instance. For this reason this only works correctly for events dispatched through ComposableTag.fire (i.e. not for native events).
Optional
options: AddEventListenerOptionsUnregisters one or all handlers of the given event. If no matching handler(s) is/are currently registered, this does nothing.
either the type string or the class the handler was registered with.
Optional
handler: EventHandler<Event>specific handler to remove, or omit to remove all handlers for the given event
Attach the underlying node to the given target, specified as an existing node or a selector.
a function that unmounts and frees this tag.
Base class that manages a single native DOM node.
Also provides a number of static factory functions to create common tags (e.g. Tag.div, Tag.span, Tag.h, Tag.p...).
Instance functionality is separated into composition and usage concerns.
This base class only exposes usage functionality, while ComposableTag adds composition functionality. By using this class as a return type, functions can effectively expose only usage functionality, reserving composition as an internal concern.