v0.18.186 - 60.8 / 49.3

XML

Set of utilities to create components from cached tagged templates. Inspired and influenced by @trusktr

Unlike HTML, attributes, tags and components are case sensitive. The xml function matches the use of JSX.

# Snippet

# Value

Used to return a real element, but not anymore.

# Defining a Global User Component

By defining a user component on the exported xml it will make the component global (accessible when importing xml from other files)

# Defining a Local User Component

To not pollute the registry one may import XML and create a an instance of xml that its local to the file

# Predefined Components

Predefined components are: Collapse, Dynamic, For, Head, Portal, Show, Switch

# Notes

  1. children as an attribute will be used as long as the node doesnt have any childNodes (just like in JSX). It must be totally empty, or else the children attribute will be ignored
  2. on xml.define the registry is case sensitive
  3. on xml.define it is possible to define a component named div, and make all divs behave differently. This is a warning, not a recommendation.

# No JSX

Making a tagged component

# Reactive Tagged Template

Making a reactive tagged template without using JSX

# Reactive Tagged Template With JSX

Making a reactive tagged template that uses JSX

# Custom Component

Making a custom component

# Show Off

Testing the Show component

# Nested Show

Nesting components with callbacks

# Attributes test

Attributes and properties

# Two xml

One calling the other

# Custom Element

When is called the custom element constructor?

# Context

Display context value while nested

# Custom Element

Custom Element Tracking Test