Chapter 36

/

Components reference

Components reference

66 built-in elements in eleven groups, each with its signature, its props, its flags, its events and its parts — read from the compiler's registry, so what this page lists is exactly what the checker accepts. Every element is written Name(positional, prop: value).flag { block }.

On every element

Every element takes these props, and the HTML attribute families named on it (aria-*, data-*, and the global attributes such as id, class, title, role, tabindex).

On every element
Prop Type Meaning
animate: .fadeIn .fadeOut .slideUp .slideDown .slideLeft .slideRight .scaleIn .scaleOut .bounce .shake .pulse .spin .expand .collapse

Animation played when the element appears

exit: .fadeIn .fadeOut .slideUp .slideDown .slideLeft .slideRight .scaleIn .scaleOut .bounce .shake .pulse .spin .expand .collapse

Animation played when the element leaves

speed: .fast .normal .slow

How fast its animation runs

duration: String

Animation length, e.g. 300ms

delay: String

Wait before the animation starts

easing: .standard .spring .ease .easeIn .easeOut .easeInOut .linear .bouncy .smooth

How the animation is paced — a named easing, or any CSS timing function

stagger: String

Delay added per item of a list, e.g. 50ms

on: .mount .enterView

When its animation plays

count: String

How long the number it shows takes to count to a new value, e.g. 600ms

shared: String

A name this element keeps across a route change, so the browser carries it from one page to the next

class: String

Classes added beside the engine's, from the project's own stylesheets

ref: State

A handle on the element, usable as the element: ref: nameInput, then nameInput.focus()

Events

on click

The element was clicked or activated

on input

The value changed, on every keystroke

on change

The value was committed

on submit

The form was submitted

on focus

The element received focus

on blur

The element lost focus

on keydown

A key went down; `e.key` names it

on key

One key, named: `on key("ctrl+k") { }`

on keyup

A key came up

on keypress

A character key was pressed

on mouseenter

The pointer entered the element

on mouseleave

The pointer left the element

on dblclick

The element was double-clicked

on contextmenu

The context menu was asked for; `e.preventDefault()` keeps the browser's

on mousedown

A mouse button went down over the element

on mouseup

A mouse button came up over the element

on mousemove

The mouse moved over the element

on mouseover

The pointer moved onto the element or one of its children

on mouseout

The pointer moved off the element or one of its children

on pointerdown

A pointer — mouse, pen or touch — went down

on pointerup

A pointer came up

on pointermove

A pointer moved

on pointerenter

A pointer entered the element

on pointerleave

A pointer left the element

on pointercancel

The browser took the pointer back, for a scroll or a gesture

on touchstart

A finger touched the element

on touchend

A finger left the element

on touchmove

A finger moved across the element

on wheel

The wheel or trackpad scrolled over the element

on scroll

The element's content scrolled

on focusin

The element or something inside it received focus

on focusout

The element or something inside it lost focus

on reset

The form was reset

on invalid

A control failed the browser's own validation

on select

Text in a field was selected

on copy

Something was copied from the element

on cut

Something was cut from the element

on paste

Something was pasted into the element; `e.clipboardData` holds it

on dragstart

The element started being dragged

on drag

The element is being dragged

on dragend

A drag of the element ended

on dragenter

Something dragged entered the element

on dragover

Something dragged is over the element; `e.preventDefault()` allows a drop

on dragleave

Something dragged left the element

on drop

Something was dropped on the element; `e.dataTransfer` holds it

on load

An image, video or frame finished loading

on error

An image, video or script failed to load

on play

A video or audio started playing

on pause

A video or audio paused

on ended

A video or audio reached its end

on timeupdate

A playing video or audio moved on

on animationend

A CSS animation on the element ended

on transitionend

A CSS transition on the element ended

on toggle

A details element opened or closed

Icons

The names Icon(…), IconButton(icon:) and Sidebar.Item(icon:) draw; any other name shows as the word, and the compiler warns.

close

menu

search

home

user

settings

check

plus

minus

edit

trash

star

heart

mail

bell

download

upload

eye

link

calendar

filter

chevron-down

chevron-right

chevron-left

info

warning

arrow-left

arrow-right

logout

copy

sun

moon