![]() * cargo update Updating crates.io index Updating ab_glyph v0.2.18 -> v0.2.20 Updating ab_glyph_rasterizer v0.1.7 -> v0.1.8 Updating ahash v0.8.2 -> v0.8.3 Updating anyhow v1.0.66 -> v1.0.68 Updating async-broadcast v0.4.1 -> v0.5.0 Updating async-recursion v1.0.0 -> v1.0.2 Updating async-trait v0.1.59 -> v0.1.64 Updating atomic_refcell v0.1.8 -> v0.1.9 Updating bumpalo v3.11.1 -> v3.12.0 Updating bytemuck v1.12.3 -> v1.13.0 Updating bytemuck_derive v1.3.0 -> v1.4.0 Updating bytes v1.3.0 -> v1.4.0 Updating calloop v0.10.3 -> v0.10.5 Updating cc v1.0.77 -> v1.0.79 Removing chunked_transfer v1.4.0 Updating clipboard-win v4.4.2 -> v4.5.0 Updating concurrent-queue v2.0.0 -> v2.1.0 Updating cxx v1.0.83 -> v1.0.89 Updating cxx-build v1.0.83 -> v1.0.89 Updating cxxbridge-flags v1.0.83 -> v1.0.89 Updating cxxbridge-macro v1.0.83 -> v1.0.89 Updating document-features v0.2.6 -> v0.2.7 Updating dyn-clone v1.0.9 -> v1.0.10 Updating either v1.8.0 -> v1.8.1 Updating enum-map v2.4.1 -> v2.4.2 Updating enum-map-derive v0.10.0 -> v0.11.0 Updating futures-core v0.3.25 -> v0.3.26 Updating futures-io v0.3.25 -> v0.3.26 Updating futures-sink v0.3.25 -> v0.3.26 Updating futures-task v0.3.25 -> v0.3.26 Updating futures-util v0.3.25 -> v0.3.26 Updating glob v0.3.0 -> v0.3.1 Updating heck v0.4.0 -> v0.4.1 Updating image v0.24.4 -> v0.24.5 Updating itoa v1.0.4 -> v1.0.5 Updating jpeg-decoder v0.2.6 -> v0.3.0 Updating js-sys v0.3.60 -> v0.3.61 Updating libc v0.2.138 -> v0.2.139 Updating link-cplusplus v1.0.7 -> v1.0.8 Updating nom v7.1.1 -> v7.1.3 Adding nom8 v0.2.0 Updating num_enum v0.5.7 -> v0.5.9 Updating num_enum_derive v0.5.7 -> v0.5.9 Updating once_cell v1.16.0 -> v1.17.0 Updating ordered-stream v0.1.2 -> v0.1.4 Updating owned_ttf_parser v0.17.1 -> v0.18.1 Updating parking_lot_core v0.9.5 -> v0.9.7 Updating paste v1.0.9 -> v1.0.11 Updating plist v1.3.1 -> v1.4.0 Updating polling v2.5.1 -> v2.5.2 Updating proc-macro-crate v1.2.1 -> v1.3.0 Updating proc-macro2 v1.0.47 -> v1.0.50 Updating puffin v0.14.0 -> v0.14.2 Updating puffin_http v0.11.0 -> v0.11.1 Adding quick-xml v0.26.0 Updating quote v1.0.21 -> v1.0.23 Updating regex v1.7.0 -> v1.7.1 Updating rustls v0.20.7 -> v0.20.8 Updating ryu v1.0.11 -> v1.0.12 Updating scratch v1.0.2 -> v1.0.3 Updating serde v1.0.149 -> v1.0.152 Updating serde_derive v1.0.149 -> v1.0.152 Updating serde_json v1.0.89 -> v1.0.91 Updating serde_repr v0.1.9 -> v0.1.10 Updating syn v1.0.105 -> v1.0.107 Updating termcolor v1.1.3 -> v1.2.0 Updating thiserror v1.0.37 -> v1.0.38 Updating thiserror-impl v1.0.37 -> v1.0.38 Updating tinyvec_macros v0.1.0 -> v0.1.1 Updating toml v0.5.9 -> v0.5.11 Adding toml_datetime v0.5.1 Adding toml_edit v0.18.1 Updating ttf-parser v0.17.1 -> v0.18.1 Updating typenum v1.15.0 -> v1.16.0 Updating unicode-bidi v0.3.8 -> v0.3.10 Updating unicode-ident v1.0.5 -> v1.0.6 Updating ureq v2.5.0 -> v2.6.2 Updating wasm-bindgen v0.2.83 -> v0.2.84 Updating wasm-bindgen-backend v0.2.83 -> v0.2.84 Updating wasm-bindgen-futures v0.4.33 -> v0.4.34 Updating wasm-bindgen-macro v0.2.83 -> v0.2.84 Updating wasm-bindgen-macro-support v0.2.83 -> v0.2.84 Updating wasm-bindgen-shared v0.2.83 -> v0.2.84 Updating wayland-sys v0.30.0 -> v0.30.1 Updating web-sys v0.3.60 -> v0.3.61 Updating webbrowser v0.8.6 -> v0.8.7 Updating webpki-roots v0.22.5 -> v0.22.6 Updating which v4.3.0 -> v4.4.0 Updating x11-dl v2.20.1 -> v2.21.0 Updating zbus v3.6.2 -> v3.8.0 Updating zbus_macros v3.6.2 -> v3.8.0 Updating zbus_names v2.4.0 -> v2.5.0 Updating zstd-sys v2.0.4+zstd.1.5.2 -> v2.0.6+zstd.1.5.2 Updating zvariant v3.9.0 -> v3.10.0 Updating zvariant_derive v3.9.0 -> v3.10.0 * Remove unnecessary import of wasm_bindgen::JsCast (its now in prelude) * egui_glow/README.md: add line on how to run the example * revert wasm-bindgen update * Revert "Remove unnecessary import of wasm_bindgen::JsCast (its now in prelude)" This reverts commit 95c3076cce76577d9f0f35e48f99b4acd2dbe62e. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
CHANGELOG.md | ||
README.md |
eframe: the egui
framework
eframe
is the official framework library for writing apps using egui
. The app can be compiled both to run natively (cross platform) or be compiled to a web app (using WASM).
To get started, see the examples.
To learn how to set up eframe
for web and native, go to https://github.com/emilk/eframe_template/ and follow the instructions there!
There is also a tutorial video at https://www.youtube.com/watch?v=NtUkr_z7l84.
For how to use egui
, see the egui docs.
eframe
uses egui_glow
for rendering, and on native it uses egui-winit
.
To use on Linux, first run:
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
You need to either use edition = "2021"
, or set resolver = "2"
in the [workspace]
section of your to-level Cargo.toml
. See this link for more info.
You can opt-in to the using egui_wgpu
for rendering by enabling the wgpu
feature and setting NativeOptions::renderer
to Renderer::Wgpu
.
Alternatives
eframe
is not the only way to write an app using egui
! You can also try egui-miniquad
, bevy_egui
, egui_sdl2_gl
, and others.
You can also use egui_glow
and winit
to build your own app as demonstrated in https://github.com/emilk/egui/blob/master/crates/egui_glow/examples/pure_glow.rs.
Problems with running egui on the web
eframe
uses WebGL (via glow
) and WASM, and almost nothing else from the web tech stack. This has some benefits, but also produces some challenges and serious downsides.
- Rendering: Getting pixel-perfect rendering right on the web is very difficult.
- Search: you cannot search an egui web page like you would a normal web page.
- Bringing up an on-screen keyboard on mobile: there is no JS function to do this, so
eframe
fakes it by adding some invisible DOM elements. It doesn't always work. - Mobile text editing is not as good as for a normal web app.
- Accessibility: There is an experimental screen reader for
eframe
, but it has to be enabled explicitly. There is no JS function to ask "Does the user want a screen reader?" (and there should probably not be such a function, due to user tracking/integrity concerns). - No integration with browser settings for colors and fonts.
In many ways, eframe
is trying to make the browser do something it wasn't designed to do (though there are many things browser vendors could do to improve how well libraries like egui work).
The suggested use for eframe
are for web apps where performance and responsiveness are more important than accessibility and mobile text editing.
Companion crates
Not all rust crates work when compiled to WASM, but here are some useful crates have been designed to work well both natively and as WASM:
Name
The frame in eframe
stands both for the frame in which your egui
app resides and also for "framework" (frame
is a framework, egui
is a library).