🥮 mooncakes.io
    Sign in

    #HTML

    The html package provides wrapper functions for all HTML elements. Basic usage:

    ///|
    fn view(emit : Emit[Msg], model : Model) -> Html {
    div(id="counter", style=["border: 1px solid black"], [
    h1(id="title", "the count is \{model.count}"),
    button(class="...", on_click=emit(Inc), "+"),
    button(class="...", on_click=emit(Dec), "-"),
    ])
    }

    Frequently used attributes are exposed as optional arguments. To access any HTML attribute, see Attribute Builder. Most HTML wrappers accept a positional argument whose type is constrained by IsChildren, so you can pass an Array[Html] or a String. See Children for details.

    There are also a few special helpers you will use frequently:

    • text()

      To represent text in HTML, use the text function.

      ///|
      let _ = p([text("hello world")])
      let _ = p("hello world") // equivalent to above

    • nothing

      It does not represent an actual HTML element. This is useful when handling multiple Option values in your model:

      ///|
      fn bad(path : Path, tag : Tag?) {
      let path = foo(path)
      let tag = match tag {
      None => []
      Some(x) => [view(x)] // Yuck!
      }
      div([path] + tag) // Don't do this
      }

      ///|
      fn good(path : Path, tag : Tag?) {
      let path = foo(path)
      let tag = match tag {
      None => nothing
      Some(x) => view(x)
      }
      div([path, tag]) // Use @html.nothing
      }

    #Children

    Almost every HTML element accepts a positional argument whose type is bounded by the IsChildren trait. This means you can pass any type that implements this trait as children to the HTML wrapper.

    Currently it accepts the following types:

    typeexample
    Array[Html]div([html1, html2])
    Stringdiv("string here")
    Htmldiv(p([...]))
    Map[String,Html]div({"k1": html1, "k2": html2})

    #Keyed Children

    When children are passed as Map[String, Html], Rabbita treats them as keyed children. Keys are used to match and reuse nodes across updates, which helps preserve DOM and Cell state when items are inserted, removed, or reordered.

    • Keys must be unique and stable (use a business ID, not an array index).
    • Changing a key means the old node is removed and a new one is created.

    Example:

    ///|
    let html : Html = ul({
    "todo-1": li("Buy milk"),
    "todo-2": li("Write docs"),
    "todo-3": li("Write code"),
    })

    #Event Handlers

    Rabbita separates event callbacks from UI views to manage side effects and avoid stale state, keeping UI predictable as code grows.

    HTML wrappers provide common events as optional arguments like on_click, on_mouseup, on_scroll, and on_submit. Each requires a Cmd binding to a Msg you define. When an event fires, the Msg (and any extra payload) is forwarded to the centralized state update function.

    Registering the same event more than once composes the handlers in registration order. When a wrapper receives both an event in attrs and its matching named event argument, the attrs handler runs first and the named handler runs second. Non-event attributes and properties keep their usual last-write-wins behavior.

    Example:

    ///|
    #cfg(target="js")
    fn update2(msg : Msg2, _ : Model2) -> Model2 {
    match msg {
    StartDraw(mouse) => println("start at \{mouse.offset_pos()}")
    EndDraw(mouse) => println("end at \{mouse.offset_pos()}")
    }
    }

    ///|
    fn view2(emit : Emit[Msg2], _ : Model2) -> Html {
    canvas(
    on_mousedown=m => emit(StartDraw(m)),
    on_mouseup=m => emit(EndDraw(m)),
    nothing,
    )
    }

    #Advanced Usage

    #Attribute Builder

    The attribute builder is a workaround for cases where the HTML wrapper does not expose a specific attribute or event. It is not the primary API and may be less ergonomic or less type-safe than the dedicated wrapper parameters. Prefer the wrapper options when available, and fall back to the builder only when needed.

    Example:

    ///|
    let html1 : Html = div(
    attrs=Attrs::build().class("card").styles(@style.Style::new().gap(12)).data("..."),
    [text("Hello")],
    )

    #Escape Hatch

    The wrapper functions and properties provided here may not cover all possible use cases. If you encounter missing functionality, feel free to file an issue or use the node() function as a workaround. The node() function allows you to manually specify the tag name, attributes, and children for your HTML element, offering flexibility for advanced or uncommon scenarios.

    ///|
    let html2 : Html = node(
    "div",
    Attrs::build().class("card").styles(@style.Style::new().gap(12)).data("..."),
    [p("text1"), p("text2")],
    )

    Attrs

    type Attrs

    Attrs::abbr

    fn Attrs::abbr(self : Attrs, value : String) -> Attrs

    Attrs::accept

    fn Attrs::accept(self : Attrs, value : String) -> Attrs

    Attrs::accept_charset

    fn Attrs::accept_charset(self : Attrs, value : String) -> Attrs

    Attrs::accesskey

    fn Attrs::accesskey(self : Attrs, value : String) -> Attrs

    Attrs::action

    fn Attrs::action(self : Attrs, value : String) -> Attrs

    Attrs::align

    fn Attrs::align(self : Attrs, value : String) -> Attrs

    Attrs::allow

    fn Attrs::allow(self : Attrs, value : String) -> Attrs

    Attrs::allowfullscreen

    fn Attrs::allowfullscreen(self : Attrs, value : Bool) -> Attrs

    Attrs::alpha

    fn Attrs::alpha(self : Attrs, value : String) -> Attrs

    Attrs::alt

    fn Attrs::alt(self : Attrs, value : String) -> Attrs

    Attrs::anchor

    fn Attrs::anchor(self : Attrs, value : String) -> Attrs

    Attrs::aria_activedescendant

    fn Attrs::aria_activedescendant(self : Attrs, value : String) -> Attrs

    Attrs::aria_atomic

    fn Attrs::aria_atomic(self : Attrs, value : String) -> Attrs

    Attrs::aria_autocomplete

    fn Attrs::aria_autocomplete(self : Attrs, value : String) -> Attrs

    Attrs::aria_braillelabel

    fn Attrs::aria_braillelabel(self : Attrs, value : String) -> Attrs

    Attrs::aria_brailleroledescription

    fn Attrs::aria_brailleroledescription(self : Attrs, value : String) -> Attrs

    Attrs::aria_busy

    fn Attrs::aria_busy(self : Attrs, value : String) -> Attrs

    Attrs::aria_checked

    fn Attrs::aria_checked(self : Attrs, value : String) -> Attrs

    Attrs::aria_colcount

    fn Attrs::aria_colcount(self : Attrs, value : String) -> Attrs

    Attrs::aria_colindex

    fn Attrs::aria_colindex(self : Attrs, value : String) -> Attrs

    Attrs::aria_colindextext

    fn Attrs::aria_colindextext(self : Attrs, value : String) -> Attrs

    Attrs::aria_colspan

    fn Attrs::aria_colspan(self : Attrs, value : String) -> Attrs

    Attrs::aria_controls

    fn Attrs::aria_controls(self : Attrs, value : String) -> Attrs

    Attrs::aria_current

    fn Attrs::aria_current(self : Attrs, value : String) -> Attrs

    Attrs::aria_describedby

    fn Attrs::aria_describedby(self : Attrs, value : String) -> Attrs

    Attrs::aria_description

    fn Attrs::aria_description(self : Attrs, value : String) -> Attrs

    Attrs::aria_details

    fn Attrs::aria_details(self : Attrs, value : String) -> Attrs

    Attrs::aria_disabled

    fn Attrs::aria_disabled(self : Attrs, value : String) -> Attrs

    Attrs::aria_dropeffect

    fn Attrs::aria_dropeffect(self : Attrs, value : String) -> Attrs

    Attrs::aria_errormessage

    fn Attrs::aria_errormessage(self : Attrs, value : String) -> Attrs

    Attrs::aria_expanded

    fn Attrs::aria_expanded(self : Attrs, value : String) -> Attrs

    Attrs::aria_flowto

    fn Attrs::aria_flowto(self : Attrs, value : String) -> Attrs

    Attrs::aria_grabbed

    fn Attrs::aria_grabbed(self : Attrs, value : String) -> Attrs

    Attrs::aria_haspopup

    fn Attrs::aria_haspopup(self : Attrs, value : String) -> Attrs

    Attrs::aria_hidden

    fn Attrs::aria_hidden(self : Attrs, value : String) -> Attrs

    Attrs::aria_invalid

    fn Attrs::aria_invalid(self : Attrs, value : String) -> Attrs

    Attrs::aria_keyshortcuts

    fn Attrs::aria_keyshortcuts(self : Attrs, value : String) -> Attrs

    Attrs::aria_label

    fn Attrs::aria_label(self : Attrs, value : String) -> Attrs

    Attrs::aria_labelledby

    fn Attrs::aria_labelledby(self : Attrs, value : String) -> Attrs

    Attrs::aria_level

    fn Attrs::aria_level(self : Attrs, value : String) -> Attrs

    Attrs::aria_live

    fn Attrs::aria_live(self : Attrs, value : String) -> Attrs

    Attrs::aria_modal

    fn Attrs::aria_modal(self : Attrs, value : String) -> Attrs

    Attrs::aria_multiline

    fn Attrs::aria_multiline(self : Attrs, value : String) -> Attrs

    Attrs::aria_multiselectable

    fn Attrs::aria_multiselectable(self : Attrs, value : String) -> Attrs

    Attrs::aria_orientation

    fn Attrs::aria_orientation(self : Attrs, value : String) -> Attrs

    Attrs::aria_owns

    fn Attrs::aria_owns(self : Attrs, value : String) -> Attrs

    Attrs::aria_placeholder

    fn Attrs::aria_placeholder(self : Attrs, value : String) -> Attrs

    Attrs::aria_posinset

    fn Attrs::aria_posinset(self : Attrs, value : String) -> Attrs

    Attrs::aria_pressed

    fn Attrs::aria_pressed(self : Attrs, value : String) -> Attrs

    Attrs::aria_readonly

    fn Attrs::aria_readonly(self : Attrs, value : String) -> Attrs

    Attrs::aria_relevant

    fn Attrs::aria_relevant(self : Attrs, value : String) -> Attrs

    Attrs::aria_required

    fn Attrs::aria_required(self : Attrs, value : String) -> Attrs

    Attrs::aria_roledescription

    fn Attrs::aria_roledescription(self : Attrs, value : String) -> Attrs

    Attrs::aria_rowcount

    fn Attrs::aria_rowcount(self : Attrs, value : String) -> Attrs

    Attrs::aria_rowindex

    fn Attrs::aria_rowindex(self : Attrs, value : String) -> Attrs

    Attrs::aria_rowindextext

    fn Attrs::aria_rowindextext(self : Attrs, value : String) -> Attrs

    Attrs::aria_rowspan

    fn Attrs::aria_rowspan(self : Attrs, value : String) -> Attrs

    Attrs::aria_selected

    fn Attrs::aria_selected(self : Attrs, value : String) -> Attrs

    Attrs::aria_setsize

    fn Attrs::aria_setsize(self : Attrs, value : String) -> Attrs

    Attrs::aria_sort

    fn Attrs::aria_sort(self : Attrs, value : String) -> Attrs

    Attrs::aria_valuemax

    fn Attrs::aria_valuemax(self : Attrs, value : String) -> Attrs

    Attrs::aria_valuemin

    fn Attrs::aria_valuemin(self : Attrs, value : String) -> Attrs

    Attrs::aria_valuenow

    fn Attrs::aria_valuenow(self : Attrs, value : String) -> Attrs

    Attrs::aria_valuetext

    fn Attrs::aria_valuetext(self : Attrs, value : String) -> Attrs

    Attrs::as_

    fn Attrs::as_(self : Attrs, value : String) -> Attrs

    Attrs::async_

    fn Attrs::async_(self : Attrs, value : Bool) -> Attrs

    Attrs::autocapitalize

    fn Attrs::autocapitalize(self : Attrs, value : String) -> Attrs

    Attrs::autocomplete

    fn Attrs::autocomplete(self : Attrs, value : AutoComplete) -> Attrs

    Attrs::autocorrect

    fn Attrs::autocorrect(self : Attrs, value : String) -> Attrs

    Attrs::autofocus

    fn Attrs::autofocus(self : Attrs, value : Bool) -> Attrs

    Attrs::autoplay

    fn Attrs::autoplay(self : Attrs, value : Bool) -> Attrs

    Attrs::background

    fn Attrs::background(self : Attrs, value : String) -> Attrs

    Attrs::bgcolor

    fn Attrs::bgcolor(self : Attrs, value : String) -> Attrs

    Attrs::border

    fn Attrs::border(self : Attrs, value : Int) -> Attrs

    Attrs::build

    fn Attrs::build() -> Attrs

    Attrs::capture

    fn Attrs::capture(self : Attrs, value : String) -> Attrs

    Attrs::charset

    fn Attrs::charset(self : Attrs, value : String) -> Attrs

    Attrs::checked

    fn Attrs::checked(self : Attrs, value : Bool) -> Attrs

    Attrs::cite

    fn Attrs::cite(self : Attrs, value : String) -> Attrs

    Attrs::class

    fn Attrs::class(self : Attrs, value : String) -> Attrs

    Attrs::closedby

    fn Attrs::closedby(self : Attrs, value : String) -> Attrs

    Set the dialog closedby attribute.

    Browser support is limited. Rabbita only emits the attribute; it does not polyfill dismissal behavior. Values include "none", "closerequest", and "any". MDN

    Attrs::color

    fn Attrs::color(self : Attrs, value : String) -> Attrs

    Attrs::colorspace

    fn Attrs::colorspace(self : Attrs, value : String) -> Attrs

    Attrs::cols

    fn Attrs::cols(self : Attrs, value : Int) -> Attrs

    Attrs::colspan

    fn Attrs::colspan(self : Attrs, value : Int) -> Attrs

    Attrs::content

    fn Attrs::content(self : Attrs, value : String) -> Attrs

    Attrs::contenteditable

    fn Attrs::contenteditable(self : Attrs, value : String) -> Attrs

    Attrs::controls

    fn Attrs::controls(self : Attrs, value : Bool) -> Attrs

    Attrs::coords

    fn Attrs::coords(self : Attrs, value : String) -> Attrs

    Attrs::copy

    fn Attrs::copy(self : Attrs) -> Attrs

    Return an independent copy that can be extended without mutating self.

    Attrs::crossorigin

    fn Attrs::crossorigin(self : Attrs, value : String) -> Attrs

    Attrs::csp

    fn Attrs::csp(self : Attrs, value : String) -> Attrs

    Attrs::data

    fn Attrs::data(self : Attrs, value : String) -> Attrs

    Attrs::data_set

    fn Attrs::data_set(self : Attrs, name : String, value : String) -> Attrs

    Attrs::datetime

    fn Attrs::datetime(self : Attrs, value : String) -> Attrs

    Attrs::decoding

    fn Attrs::decoding(self : Attrs, value : String) -> Attrs

    Attrs::default

    fn Attrs::default(self : Attrs, value : Bool) -> Attrs

    Attrs::defer_

    fn Attrs::defer_(self : Attrs, value : Bool) -> Attrs

    Attrs::dir

    fn Attrs::dir(self : Attrs, value : String) -> Attrs

    Attrs::dirname

    fn Attrs::dirname(self : Attrs, value : String) -> Attrs

    Attrs::disabled

    fn Attrs::disabled(self : Attrs, value : Bool) -> Attrs

    Attrs::download

    fn Attrs::download(self : Attrs, value : String) -> Attrs

    Attrs::draggable

    fn Attrs::draggable(self : Attrs, value : String) -> Attrs

    Attrs::elementtiming

    fn Attrs::elementtiming(self : Attrs, value : String) -> Attrs

    Attrs::enctype

    fn Attrs::enctype(self : Attrs, value : String) -> Attrs

    Attrs::enterkeyhint

    fn Attrs::enterkeyhint(self : Attrs, value : String) -> Attrs

    Attrs::exportparts

    fn Attrs::exportparts(self : Attrs, value : String) -> Attrs

    Attrs::fetchpriority

    fn Attrs::fetchpriority(self : Attrs, value : String) -> Attrs

    Attrs::for_

    fn Attrs::for_(self : Attrs, value : String) -> Attrs

    Attrs::form

    fn Attrs::form(self : Attrs, value : String) -> Attrs

    Attrs::formaction

    fn Attrs::formaction(self : Attrs, value : String) -> Attrs

    Attrs::formenctype

    fn Attrs::formenctype(self : Attrs, value : String) -> Attrs

    Attrs::formmethod

    fn Attrs::formmethod(self : Attrs, value : String) -> Attrs

    Attrs::formnovalidate

    fn Attrs::formnovalidate(self : Attrs, value : Bool) -> Attrs

    Attrs::formtarget

    fn Attrs::formtarget(self : Attrs, value : String) -> Attrs

    Attrs::headers

    fn Attrs::headers(self : Attrs, value : String) -> Attrs

    Attrs::height

    fn Attrs::height(self : Attrs, value : Int) -> Attrs

    Attrs::hidden

    fn Attrs::hidden(self : Attrs, value : Bool) -> Attrs

    Attrs::high

    fn Attrs::high(self : Attrs, value : Int) -> Attrs

    Attrs::href

    fn Attrs::href(self : Attrs, value : String) -> Attrs

    Attrs::hreflang

    fn Attrs::hreflang(self : Attrs, value : String) -> Attrs

    Attrs::http_equiv

    fn Attrs::http_equiv(self : Attrs, value : String) -> Attrs

    Attrs::id

    fn Attrs::id(self : Attrs, value : String) -> Attrs

    Attrs::inert

    fn Attrs::inert(self : Attrs, value : Bool) -> Attrs

    Attrs::inner_html

    #internal(xss_vulnerable, "This function may cause xss attack.")
    fn Attrs::inner_html(self : Attrs, html : String) -> Attrs

    Sets raw HTML and bypasses normal escaping.

    Vulnerability Warning

    This is XSS‑prone and should only be used with trusted or sanitized input. It affects both HTML and SVG content since the browser will parse the string into DOM nodes.

    Attrs::inputmode

    fn Attrs::inputmode(self : Attrs, value : String) -> Attrs

    Attrs::integrity

    fn Attrs::integrity(self : Attrs, value : String) -> Attrs

    Attrs::is_

    fn Attrs::is_(self : Attrs, value : String) -> Attrs

    Attrs::ismap

    fn Attrs::ismap(self : Attrs, value : Bool) -> Attrs

    Attrs::itemid

    fn Attrs::itemid(self : Attrs, value : String) -> Attrs

    Attrs::itemprop

    fn Attrs::itemprop(self : Attrs, value : String) -> Attrs

    Attrs::itemref

    fn Attrs::itemref(self : Attrs, value : String) -> Attrs

    Attrs::itemscope

    fn Attrs::itemscope(self : Attrs, value : Bool) -> Attrs

    Attrs::itemtype

    fn Attrs::itemtype(self : Attrs, value : String) -> Attrs

    Attrs::kind

    fn Attrs::kind(self : Attrs, value : String) -> Attrs

    Attrs::label

    fn Attrs::label(self : Attrs, value : String) -> Attrs

    Attrs::lang

    fn Attrs::lang(self : Attrs, value : String) -> Attrs

    Attrs::language

    fn Attrs::language(self : Attrs, value : String) -> Attrs

    Attrs::list

    fn Attrs::list(self : Attrs, value : String) -> Attrs

    Attrs::loading

    fn Attrs::loading(self : Attrs, value : String) -> Attrs

    Attrs::loop_

    fn Attrs::loop_(self : Attrs, value : Bool) -> Attrs

    Attrs::low

    fn Attrs::low(self : Attrs, value : Int) -> Attrs

    Attrs::max

    fn Attrs::max(self : Attrs, value : Int) -> Attrs

    Attrs::maxlength

    fn Attrs::maxlength(self : Attrs, value : Int) -> Attrs

    Attrs::media

    fn Attrs::media(self : Attrs, value : String) -> Attrs

    Attrs::method_

    fn Attrs::method_(self : Attrs, value : String) -> Attrs

    Attrs::min

    fn Attrs::min(self : Attrs, value : Int) -> Attrs

    Attrs::minlength

    fn Attrs::minlength(self : Attrs, value : Int) -> Attrs

    Attrs::multiple

    fn Attrs::multiple(self : Attrs, value : Bool) -> Attrs

    Attrs::muted

    fn Attrs::muted(self : Attrs, value : Bool) -> Attrs

    Attrs::name

    fn Attrs::name(self : Attrs, value : String) -> Attrs

    Attrs::nonce

    fn Attrs::nonce(self : Attrs, value : String) -> Attrs

    Attrs::novalidate

    fn Attrs::novalidate(self : Attrs, value : Bool) -> Attrs

    Attrs::on_pointercancel

    Handle browser cancellation of an active pointer interaction.

    Attrs::on_pointerdown

    Handle a primary or auxiliary pointer starting contact with the element.

    PointerEvent extends the browser's mouse-event surface, so the callback uses Rabbita's existing MouseEvent wrapper while preserving pointer-only fields for JavaScript FFI helpers.

    Attrs::on_pointermove

    Handle movement from a captured mouse, pen, or touch pointer.

    Attrs::on_pointerup

    Handle the end of a mouse, pen, or touch pointer interaction.

    Attrs::open

    fn Attrs::open(self : Attrs, value : Bool) -> Attrs

    Attrs::optimum

    fn Attrs::optimum(self : Attrs, value : Int) -> Attrs

    Attrs::part

    fn Attrs::part(self : Attrs, value : String) -> Attrs

    Attrs::pattern

    fn Attrs::pattern(self : Attrs, value : String) -> Attrs

    Attrs::ping

    fn Attrs::ping(self : Attrs, value : String) -> Attrs

    Attrs::placeholder

    fn Attrs::placeholder(self : Attrs, value : String) -> Attrs

    Attrs::playsinline

    fn Attrs::playsinline(self : Attrs, value : Bool) -> Attrs

    Attrs::popover

    fn Attrs::popover(self : Attrs, value : String) -> Attrs

    Attrs::poster

    fn Attrs::poster(self : Attrs, value : String) -> Attrs

    Attrs::preload

    fn Attrs::preload(self : Attrs, value : String) -> Attrs

    Attrs::readonly_

    fn Attrs::readonly_(self : Attrs, value : Bool) -> Attrs

    Attrs::referrerpolicy

    fn Attrs::referrerpolicy(self : Attrs, value : String) -> Attrs

    Attrs::rel

    fn Attrs::rel(self : Attrs, value : String) -> Attrs

    Attrs::required

    fn Attrs::required(self : Attrs, value : Bool) -> Attrs

    Attrs::reversed

    fn Attrs::reversed(self : Attrs, value : Bool) -> Attrs

    Attrs::role

    fn Attrs::role(self : Attrs, value : String) -> Attrs

    Attrs::rows

    fn Attrs::rows(self : Attrs, value : Int) -> Attrs

    Attrs::rowspan

    fn Attrs::rowspan(self : Attrs, value : Int) -> Attrs

    Attrs::sandbox

    fn Attrs::sandbox(self : Attrs, value : String) -> Attrs

    Attrs::scope

    fn Attrs::scope(self : Attrs, value : Scope) -> Attrs

    Attrs::selected

    fn Attrs::selected(self : Attrs, value : Bool) -> Attrs

    Attrs::shape

    fn Attrs::shape(self : Attrs, value : String) -> Attrs

    Attrs::size

    fn Attrs::size(self : Attrs, value : Int) -> Attrs

    Attrs::sizes

    fn Attrs::sizes(self : Attrs, value : String) -> Attrs

    Attrs::slot

    fn Attrs::slot(self : Attrs, value : String) -> Attrs

    Attrs::span

    fn Attrs::span(self : Attrs, value : Int) -> Attrs

    Attrs::spellcheck

    fn Attrs::spellcheck(self : Attrs, value : Bool) -> Attrs

    Attrs::src

    fn Attrs::src(self : Attrs, value : String) -> Attrs

    Attrs::srcdoc

    fn Attrs::srcdoc(self : Attrs, value : String) -> Attrs

    Attrs::srclang

    fn Attrs::srclang(self : Attrs, value : String) -> Attrs

    Attrs::srcset

    fn Attrs::srcset(self : Attrs, value : String) -> Attrs

    Attrs::start

    fn Attrs::start(self : Attrs, value : Int) -> Attrs

    Attrs::step

    fn Attrs::step(self : Attrs, value : Int) -> Attrs

    Attrs::style_attr

    fn Attrs::style_attr(self : Attrs, value : String) -> Attrs

    Attrs::styles

    合并一份类型化样式 —— 这是唯一的结构化样式入口。

    ★ moobile 改造:原来的 Attrs::style(key : String, value : String) 已删除。 理由有两条,都有实测支撑:

    1. 字符串通道让 fontWeight(RN 要字符串)与 fontSize(RN 要数字) 在编译期无法区分,只能靠运行时白名单兜(见 README 的 F3)。
    2. 它零调用点 —— 唯一真实应用 interest/yi 从未用过结构化样式 (136 处 class= / 0 处 style=),所以删掉不破坏任何代码。

    Attrs::summary

    fn Attrs::summary(self : Attrs, value : String) -> Attrs

    Attrs::tabindex

    fn Attrs::tabindex(self : Attrs, value : Int) -> Attrs

    Attrs::target

    fn Attrs::target(self : Attrs, value : Target) -> Attrs

    Attrs::title

    fn Attrs::title(self : Attrs, value : String) -> Attrs

    Attrs::translate

    fn Attrs::translate(self : Attrs, value : String) -> Attrs

    Attrs::type_

    fn Attrs::type_(self : Attrs, value : String) -> Attrs

    Attrs::usemap

    fn Attrs::usemap(self : Attrs, value : String) -> Attrs

    Attrs::value

    fn Attrs::value(self : Attrs, value : String) -> Attrs

    Attrs::value_int

    fn Attrs::value_int(self : Attrs, value : Int) -> Attrs

    Attrs::value_prop

    fn Attrs::value_prop(self : Attrs, value : String) -> Attrs

    Attrs::width

    fn Attrs::width(self : Attrs, value : Int) -> Attrs

    Attrs::wrap

    fn Attrs::wrap(self : Attrs, value : String) -> Attrs

    AutoComplete

    pub(all) enum AutoComplete {
    On
    Off
    }

    EventDecoders

    pub struct EventDecoders {
    mouse_event : (
    Event
    ) ->
    MouseEvent

    keyboard_event : (
    Event
    ) ->
    KeyboardEvent

    focus_event : (
    Event
    ) ->
    FocusEvent

    drag_event : (
    Event
    ) ->
    DragEvent

    clipboard_event : (
    Event
    ) ->
    ClipboardEvent

    composition_event : (
    Event
    ) ->
    CompositionEvent

    wheel_event : (
    Event
    ) ->
    WheelEvent

    ui_event : (
    Event
    ) ->
    UIEvent

    input_event : (
    Event
    ) ->
    InputEvent

    dom_event : (
    Event
    ) ->
    Event

    mouse : (
    MouseEvent
    ) ->
    Mouse

    keyboard : (
    KeyboardEvent
    ) ->
    Keyboard

    scroll : (
    UIEvent
    ) ->
    Scroll

    }

    各事件载荷的解码策略表 —— 这是 moobile 对 rabbita 的第三批实质改造。

    为什么必须做

    rabbita 原本把 DOM 语义写死在每个 on_* 处理器里:

    scheduler.add(msg(raw.to_keyboard_event().unwrap()))

    这在浏览器里成立,但 unwrap() 在任何非浏览器宿主上都会 panic。 第一次踩到的是 on_mouse_event:React Native 的 Pressable 给的是合成 press 事件,to_mouse_event() 返回 None → 点一下就崩。

    普查(_r1/dom_survey.txt)发现这不是孤例:html/ + svg/ 里共 45 处 @dom.,其中同一形状的 panic 有 13 个(下表每一栏一个)。 只修 mouse 那一处,等于把同样的雷留给 keyboard / drag / scroll / input … —— 而 yi 的罗盘拖拽(on_mousedown/move/up 读 Mouse 坐标)正好踩在里面。

    设计

    一张表、一处替换点。DOM 后端保持原样(走浏览器的事件子类型判定), React 后端整表换成"原样透传"。

    目标要说清楚:这里换来的是"不崩、可降级", 不是"载荷也等价"。真正读取载荷的处理器(罗盘拖拽读坐标) 在 RN 上仍拿不到有意义的值 —— 那是设计文档的 R2,需要接手势系统。

    Html

    #alias(T)
    pub(all) struct Html(
    VNode
    ) derive(Eq)

    An HTML value produced by the constructors in this package.

    Html::from_vnode

    Html::to_virtual_dom

    InputType

    pub(all) enum InputType {
    Button
    Checkbox
    Color
    Date
    DateTimeLocal
    Email
    File
    Hidden
    Image
    Month
    Number
    Password
    Radio
    Range
    Reset
    Search
    Submit
    Tel
    Text
    Time
    Url
    Week
    }

    Scope

    pub(all) enum Scope {
    Row
    Col
    RowGroup
    ColGroup
    }

    Target

    pub(all) enum Target {
    Self
    Blank
    }

    fn[C : IsChildren] a(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, href~ : String, target? : Target, rel? : String, download? : String, attrs? : Attrs, children : C, escape? : Bool) -> Html

    MDN Create a element.

    Parameters

    • escape: an optional boolean that determines whether the link should be escaped. By default, it is set to false.

      When escape is set to true, clicking the escaped link will cause the browser to immediately navigate to the href target, bypassing any interception logic. As a result, the UrlRequest message will not be triggered.

    • target: an optional Target that specifies where to open the link.

    If the user holds the ctrl key (or the command key on macOS) while clicking the link, the click event will be handled by the browser, and the UrlRequest will not be triggered either.

    If App::with_route(url_request=...) is not configured, browser native navigation is used as well.

    abbr

    fn[C : IsChildren] abbr(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    address

    fn[C : IsChildren] address(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    area

    fn area(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, alt? : String, coords? : String, shape? : String, href? : String, target? : String, attrs? : Attrs) -> Html

    article

    fn[C : IsChildren] article(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    aside

    fn[C : IsChildren] aside(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    audio

    fn[C : IsChildren] audio(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, src? : String, controls? : Bool, autoplay? : Bool, loop_? : Bool, muted? : Bool, preload? : String, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] b(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    base

    fn base(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, href? : String, target? : String, attrs? : Attrs) -> Html

    bdi

    fn[C : IsChildren] bdi(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    bdo

    fn[C : IsChildren] bdo(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    blockquote

    fn[C : IsChildren] blockquote(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn br(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs) -> Html

    button

    fn[C : IsChildren] button(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, type_? : String, disabled? : Bool, name? : String, value? : String, autofocus? : Bool, on_click? :
    Cmd
    , attrs? : Attrs, children : C) -> Html

    caption

    fn[C : IsChildren] caption(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    cite

    fn[C : IsChildren] cite(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    code

    fn[C : IsChildren] code(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    col

    fn col(style? : Array[String], id? : String, span? : Int, class? : String, title? : String, hidden? : Bool, attrs? : Attrs) -> Html

    colgroup

    fn[C : IsChildren] colgroup(style? : Array[String], id? : String, span? : Int, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    data

    fn[C : IsChildren] data(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    datalist

    fn[C : IsChildren] datalist(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] dd(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    del

    fn[C : IsChildren] del(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    details

    fn[C : IsChildren] details(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, open? : Bool, attrs? : Attrs, children : C) -> Html

    dfn

    fn[C : IsChildren] dfn(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    dialog

    fn[C : IsChildren] dialog(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, open? : Bool, closedby? : String, on_close? :
    Emit
    [String], on_cancel? :
    Cmd
    , attrs? : Attrs, children : C) -> Html

    MDN Dialog element.

    Hint: You can use the show and close commands in the @dialog package to manipulate the dialog.

    Attributes

    • open: indicates whether the dialog is open or closed by default.

    • closedby: emits the limited-support browser closedby attribute. Rabbita does not polyfill dismissal behavior.

    Messages

    • close: triggered when the dialog is closed.

      The string payload of the close message is the return value of the dialog.

    • cancel: triggered when the user instructs the browser that they wish to dismiss the current open dialog.

      It can be triggered when the user presses esc or uses the request_close command.

      If the cancel argument is provided, the dialog will not close automatically after this message is triggered. You can use the @dialog.close command to close it or @cmd.none to keep it open.

    Example

    typealias Model = String

    enum Msg {
    Open
    Closed(String)
    YesNo(Bool)
    }

    fn update(msg : Msg, model : Model) -> (Cmd[Msg], Model) {
    match msg {
    Open => (@dialog.show("confirm"), model)
    YesNo(answer) => (@dialog.close("confirm", return_value=answer.to_string()), model)
    Closed(value) => (none(), value)
    }
    }

    fn view(model : Model) -> Html {
    div([
    h1([text(model)]),
    button(on_click=Msg::Open, [text("open")]),
    dialog(id="confirm", on_close=Msg::Closed, [
    p([text("Are you sure?")]),
    button(on_click=YesNo(true), [text("Yes")]),
    button(on_click=YesNo(false), [text("No")]),
    ]),
    ])
    }

    fn[C : IsChildren] dl(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    dom_decoders

    fn dom_decoders() -> EventDecoders

    DOM 默认实现:走浏览器的事件子类型判定。行为与原实现逐字一致。
    fn[C : IsChildren] dt(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] em(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    embed

    fn embed(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs) -> Html

    event_decoders

    全局解码表。后端启动时替换(React 后端见 moobile/app.mbt)。

    fencedframe

    fn fencedframe(style? : Array[String], id? : String, class? : String, hidden? : Bool, src? : String, title? : String, width? : Int, height? : Int, loading? : String, allow? : String, sandbox? : String, allowfullscreen? : Bool, attrs? : Attrs) -> Html

    fieldset

    fn[C : IsChildren] fieldset(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, disabled? : Bool, name? : String, attrs? : Attrs, children : C) -> Html

    figcaption

    fn[C : IsChildren] figcaption(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    figure

    fn[C : IsChildren] figure(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] footer(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    form

    fn[C : IsChildren] form(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, action? : String, name? : String, on_submit? :
    Cmd
    , attrs? : Attrs, children : C) -> Html

    on_submit will call prevent_default() before dispatching the command. If you need the browser default behavior, use attrs with Attrs::on_submit.

    form_value_from_event

    ★ moobile 扩展:从"输入事件"里取表单值的可替换策略。

    为什么需要它:rabbita 原本把 DOM 语义写死了 —— 从事件对象上 event.currentTarget / event.target 再 .value 取值。 但 React Native 的 TextInput 回调(onChangeText)直接给字符串, 压根不存在 DOM 事件对象。于是这一步必须可替换: DOM 后端保持原样,React 后端把它换成"事件槽位里装的就是文本"。

    换掉这一个函数,on_input=emit.map(SetDraft) 就能在 RN 上原样工作 —— 也就是 yi 那种视图代码不需要改。这是 fork 换来的第二处实质收益。

    ★ 参数类型是后端无关的 Event(不再是 @dom.Event)—— DOM 实现自己负责在内部转回 @dom.Event。

    fragment

    fn fragment(children : Array[Html]) -> Html

    geolocation

    fn[C : IsChildren] geolocation(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] h1(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, cite? : String, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] h2(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] h3(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] h4(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] h5(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] h6(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] head(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] header(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    hgroup

    fn[C : IsChildren] hgroup(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn hr(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs) -> Html

    html

    fn html(style? : Array[String], id? : String, class? : String, title? : String, lang? : String, dir? : String, hidden? : Bool, attrs? : Attrs, children : Array[Html]) -> Html

    Constructs the root of an HTML document.

    Use this constructor only with exactly one head followed by exactly one body:

    html(...) <| [
    head(...),
    body(...),
    ]

    This restriction follows the Web platform's special handling of document roots: while parsing HTML, browsers may supply missing <html>, <head>, and <body> elements. Rabbita therefore leaves any other child count, order, tag, or nesting undefined.

    For the Web behavior behind this restriction, see MDN: DOMParser.parseFromString().
    fn[C : IsChildren] i(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    iframe

    fn iframe(style? : Array[String], id? : String, class? : String, hidden? : Bool, src? : String, title? : String, width? : Int, height? : Int, loading? : String, allow? : String, sandbox? : String, allowfullscreen? : Bool, attrs? : Attrs) -> Html

    img

    fn img(style? : Array[String], id? : String, class? : String, hidden? : Bool, src? : String, alt? : String, title? : String, width? : Int, height? : Int, srcset? : String, sizes? : String, loading? : String, decoding? : String, attrs? : Attrs) -> Html

    input

    fn input(input_type? : InputType, name? : String, value? : String, checked? : Bool, read_only? : Bool, multiple? : Bool, accept? : String, placeholder? : String, auto_complete? : AutoComplete, style? : Array[String], max? : Int, min? : Int, step? : Int, maxlength? : Int, minlength? : Int, pattern? : String, size? : Int, width? : Int, height? : Int, id? : String, class? : String, title? : String, hidden? : Bool, required? : Bool, autofocus? : Bool, list? : String, inputmode? : String, on_change? :
    Emit
    [String], on_input? :
    Emit
    [String], attrs? : Attrs) -> Html

    ins

    fn[C : IsChildren] ins(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    kbd

    fn[C : IsChildren] kbd(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    label

    fn[C : IsChildren] label(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, for_? : String, attrs? : Attrs, children : C) -> Html

    legend

    fn[C : IsChildren] legend(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] li(style? : Array[String], value? : Int, id? : String, class? : String, title? : String, hidden? : Bool, on_click? :
    Cmd
    , attrs? : Attrs, children : C) -> Html
    fn link(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, href? : String, rel? : String, type_? : String, media? : String, sizes? : String, attrs? : Attrs) -> Html

    main_

    fn[C : IsChildren] main_(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    map

    fn[C : IsChildren] map(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, name? : String, attrs? : Attrs, children : C) -> Html

    mark

    fn[C : IsChildren] mark(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    math

    fn[C : IsChildren] math(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] menu(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    meta

    fn meta(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, charset? : String, name? : String, content? : String, http_equiv? : String, attrs? : Attrs) -> Html

    meter

    fn[C : IsChildren] meter(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, value? : Int, min? : Int, max? : Int, low? : Int, high? : Int, optimum? : Int, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] nav(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    node

    fn[C : IsChildren] node(tag : String, attrs : Attrs, children : C) -> Html

    noscript

    fn[C : IsChildren] noscript(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    nothing

    let nothing : Html

    Represents an empty element

    object

    fn[C : IsChildren] object(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] ol(style? : Array[String], reversed? : Bool, start? : Int, id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    MDN Notice that the type attribute for ol is not important for the browser now. If you want to change the type of the list, you should use the list-style-type property in CSS.

    optgroup

    fn[C : IsChildren] optgroup(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, label? : String, disabled? : Bool, attrs? : Attrs, children : C) -> Html

    option

    fn[C : IsChildren] option(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, label? : String, disabled? : Bool, value? : String, selected? : Bool, attrs? : Attrs, children : C) -> Html

    output

    fn[C : IsChildren] output(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, name? : String, for_? : String, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] p(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    passthrough_decoders

    fn passthrough_decoders() -> EventDecoders

    透传表:给非 DOM 宿主(React Native)用。

    前十项一律"把递过来的值当作目标类型"—— 因为 RN 的合成事件不是 DOM 子类型, to_xxx_event() 一律返回 None,原来的 unwrap() 必崩(这是实测过的真 bug)。

    后三项(Mouse/Keyboard/Scroll,载荷是 rabbita 自己的类型)返回零值: 没有 DOM 就拿不到坐标、按键与滚动量。 读取这些值的处理器会拿到 0 —— 这是已知降级,不是等价替换。 (设计文档的 R2:要拿到真实手势数据得接 RN 的手势系统。)

    放在 html 里而不是 moobile 里,是因为构造 Mouse/Keyboard/Scroll 与构造结构体字段都需要包内访问权;让本包同时提供两张表代价最小。

    picture

    fn[C : IsChildren] picture(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    pre

    fn[C : IsChildren] pre(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    progress

    fn[C : IsChildren] progress(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, value? : Int, max? : Int, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] q(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] rp(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] rt(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    ruby

    fn[C : IsChildren] ruby(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] s(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    samp

    fn[C : IsChildren] samp(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    script

    fn[C : IsChildren] script(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, src? : String, type_? : String, async_? : Bool, defer_? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] search(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    section

    fn[C : IsChildren] section(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    select

    fn[C : IsChildren] select(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, disabled? : Bool, name? : String, multiple? : Bool, size? : Int, required? : Bool, autofocus? : Bool, on_change? :
    Emit
    [String], attrs? : Attrs, children : C) -> Html

    selectedcontent

    fn[C : IsChildren] selectedcontent(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    slot

    fn[C : IsChildren] slot(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    small

    fn[C : IsChildren] small(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    source

    fn source(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, src? : String, srcset? : String, media? : String, type_? : String, sizes? : String, attrs? : Attrs) -> Html

    span

    fn[C : IsChildren] span(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    strong

    fn[C : IsChildren] strong(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    style_tag

    fn[C : IsChildren] style_tag(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    sub

    fn[C : IsChildren] sub(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    summary

    fn[C : IsChildren] summary(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    sup

    fn[C : IsChildren] sup(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    svg

    fn[C : IsChildren] svg(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    table

    fn[C : IsChildren] table(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    tbody

    fn[C : IsChildren] tbody(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] td(style? : Array[String], id? : String, colspan? : Int, rowspan? : Int, headers? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    template

    fn[C : IsChildren] template(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    text

    fn text(str : String) -> Html

    textarea

    fn[C : IsChildren] textarea(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, name? : String, value? : String, rows? : Int, cols? : Int, placeholder? : String, read_only? : Bool, disabled? : Bool, maxlength? : Int, minlength? : Int, required? : Bool, autofocus? : Bool, wrap? : String, on_change? :
    Emit
    [String], on_input? :
    Emit
    [String], attrs? : Attrs, children : C) -> Html

    tfoot

    fn[C : IsChildren] tfoot(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] th(style? : Array[String], id? : String, abbr? : String, colspan? : Int, rowspan? : Int, headers? : String, scope? : Scope, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    thead

    fn[C : IsChildren] thead(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    time

    fn[C : IsChildren] time(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, datetime? : String, attrs? : Attrs, children : C) -> Html

    title

    fn[C : IsChildren] title(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] tr(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    track

    fn track(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, kind? : String, srclang? : String, label? : String, default? : Bool, src? : String, attrs? : Attrs) -> Html
    fn[C : IsChildren] u(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html
    fn[C : IsChildren] ul(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, on_click? :
    Cmd
    , attrs? : Attrs, children : C) -> Html

    var_

    fn[C : IsChildren] var_(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs, children : C) -> Html

    video

    fn[C : IsChildren] video(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, src? : String, controls? : Bool, autoplay? : Bool, loop_? : Bool, muted? : Bool, preload? : String, poster? : String, attrs? : Attrs, children : C) -> Html

    wbr

    fn wbr(style? : Array[String], id? : String, class? : String, title? : String, hidden? : Bool, attrs? : Attrs) -> Html