v0.18.186 - 34.9 / 29.6

attributes / properties

Describes behavior with attributes and properties.

# Attributes vs Properties

pota defaults to attributes since v0.18.184. Namespace prop: can be used when in need for setting a property.

# Deleting

On a property, deleting means setting the value to null when the passed value is null or undefined.

On an attribute, deleting means removing the attribute when the passed value is false , null or undefined.

# Children

children as an attribute will be used as long as the node on where it's defined doesn't have any childNodes.

# xmlns

The xmlns attribute is copied to children. Which means it supports by default most kinds if not all xmls: SVG, MathML, with its fancy namespaces.

# Events

Events such on:__ are case sensitive

# Props With Default Behavior

NameDescription
use:refcallback to get a reference to the element
use:connectedconnected adds a callback to the mount event
use:disconnecteddisconnected adds a callback to the unmount event
classsets classes in the element in various ways
stylesets styles in the element in various ways
use:css<span use:css="class{color:green} class:hover{color:red}"/> becomes <span class="c1ywn32bqhvrzp"/>

# SVG

test: SVG + xlink

# Showing XML Test

Testing if keeps the parent xmlns using a toggling Show