Skip to main content

view

Macro view 

Source
view!() { /* proc-macro */ }
Expand description

Declare a screen’s UI declaratively using JSX-like syntax.

§Supported Tags

<h1>, <h2>, <h3>, <p>, <button>, <img>, <input>, <div>, <span>, <a>

§Supported Attributes

  • class="..." — CSS class name(s)
  • src="...", alt="...", placeholder="...", href="..." — generic attrs
  • onclick=expr — tap/click handler
  • oninput=expr — input change handler
  • onkeypress=expr — key press handler
  • onfocus=expr — focus handler
  • onblur=expr — blur handler

§Built-in Event Expressions

  • alert("message") — show native alert
  • log("message") — log to console
  • navigate(ScreenName) — navigate to a screen