Crate mogwai_dom

source ·
Expand description

Mogwai

Mogwai is library for multi-domain user interface development using sinks and streams.

Its goals are simple:

  • provide a declarative approach to creating and managing interface nodes, without a bias towards a specific UI domain (ie web, games, desktop applications, mobile)
  • encapsulate component state and compose components easily
  • explicate mutations and updates
  • feel snappy

Javascript/Browser DOM

This library is specific to writing mogwai apps to run in the browser via WASM.

Learn more

Please check out the introduction module.

Acronyms

If you’re wondering what the acronym “mogwai” stands for, here is a table of options that work well, depending on the domain. It’s fun to mix and match.

MOGWAI
minimalobviousgraphicalwebapplicationinterface
modularoperablegraphablewidget
mostlyguiwork

JavaScript interoperability

This library is a thin layer on top of the web-sys crate which provides raw bindings to tons of browser web APIs. Many of the DOM specific structs, enums and traits come from web-sys. It is important to understand the JsCast trait for writing web apps in Rust. Specifically its dyn_into and dyn_ref functions are the primary way to cast JavaScript values as specific Javascript types.

Modules

An introduction to writing browser interfaces with mogwai.
Re-export of the mogwai library.
View events as streams of values.
Re-exports for convenience.
Helpers and utilities.
Wrapped views.

Macros

Uses an html description to construct a ViewBuilder.
Uses an html description to construct a ViewBuilder.
Uses a function-style description to construct a ViewBuilder.