Reference
UI elements
Every element the compiler knows, straight from src/elements.ts. All of them also take class, style, id and ref, and any DOM event with on:event.
| Element | Content | -> fires on | Props | Flags | HTML |
|---|---|---|---|---|---|
| text | text | — | role animate delay duration hover tag | bold muted small large danger primary success reveal stagger | <span> |
| title | text | — | role animate delay duration hover tag | bold muted small large danger primary success reveal stagger | <h2> |
| button | text | click | disabled role animate delay duration hover | primary danger small reveal stagger | <button> |
| input | state to bind | enter | placeholder type disabled label min max step autocomplete inputmode name role animate delay duration hover | required reveal stagger | <input> |
| textarea | state to bind | — | placeholder rows disabled label autocomplete inputmode name role animate delay duration hover | required reveal stagger | <textarea> |
| select | state to bind | change | options placeholder disabled label autocomplete name role animate delay duration hover | reveal stagger | <select> |
| checkbox | state to bind | change | label disabled role animate delay duration hover | reveal stagger | <input> |
| radio | state to bind | change | options label role animate delay duration hover | reveal stagger | <div> |
| tabs | state to bind | change | options label role animate delay duration hover | reveal stagger | <div> |
| file | state to bind | change | accept label disabled role animate delay duration hover | multiple reveal stagger | <input> |
| modal | state to bind | — | gap pad align justify role animate delay duration hover | reveal stagger | <dialog> |
| image | source URL | — | alt width height loading decoding fetchpriority srcset sizes role animate delay duration hover | reveal stagger | <img> |
| video | source URL | — | width height poster role animate delay duration hover | controls autoplay loop muted reveal stagger | <video> |
| audio | source URL | — | role animate delay duration hover | controls autoplay loop muted reveal stagger | <audio> |
| link | text | — | to href target role animate delay duration hover | muted bold reveal stagger | <a> |
| badge | text | — | role animate delay duration hover | primary success danger reveal stagger | <span> |
| icon | text | — | size label role animate delay duration hover | muted primary success danger reveal stagger | <span> |
| spinner | — | — | role animate delay duration hover | reveal stagger | <span> |
| divider | — | — | role animate delay duration hover | reveal stagger | <hr> |
| row | — | — | gap pad align justify role animate delay duration hover tag | wrap reveal stagger | <div> |
| column | — | — | gap pad align justify role animate delay duration hover tag | reveal stagger | <div> |
| grid | — | — | gap pad align justify cols role animate delay duration hover tag | reveal stagger | <div> |
| card | — | — | gap pad align justify role animate delay duration hover tag | reveal stagger | <div> |
| form | — | submit | gap pad align justify role animate delay duration hover | novalidate reveal stagger | <form> |
| list | — | — | role animate delay duration hover | reveal stagger | <ul> |
| item | text | click | role animate delay duration hover | muted reveal stagger | <li> |
| table | — | — | role animate delay duration hover | reveal stagger | <table> |
| tr | — | click | role animate delay duration hover | reveal stagger | <tr> |
| th | text | — | role animate delay duration hover | reveal stagger | <th> |
| td | text | — | role animate delay duration hover | muted bold reveal stagger | <td> |
| canvas | — | — | width height role animate delay duration hover | reveal stagger | <canvas> |
column gap=4 align=center {
title "Users"
input draft placeholder="Name" -> add(draft)
button "Add" primary -> add(draft)
for u in users key u.id {
UserCard user=u
}
}