This repository collects most of the Druid examples and arranges them (with very slight
modifications) for building with wasm-pack
and serving with a web server.
To get started first check out the rust wasm tutorial.
You will need cargo
and wasm-pack
for building the code and a simple
server like http
for serving the web pages.
First build the examples with
> wasm-pack build --target web
Then run the server from the root directory with
> http
which should start a server with our examples served in individual html documents.
Finally point your browser to the appropriate localhost url (usually http://localhost:8000) and you should see a page with a list of links, one for each example.
Examples that are known to be working (on par with native) are marked below.
- anim
- calc
- custom_widget
- either
- ext_event (No thread support on wasm)
- flex
- game_of_life
- hello
- identity
- image (Image is loaded at compile time)
- layout
- lens
- list
- multiwin (No support for menus or multiple windows)
- panels
- parse
- scroll_colors
- scroll
- split_demo
- styled_text
- svg (usvg doesn't compile for WASM at the time of this writing)
- switch_demo
- timer
- view_switcher
The examples (files in the examples
module) in this repository are taken (mostly unmodified) from
the druid
library, so all credit goes to the druid
developers.