Cargo Features

[dependencies]
eframe = { version = "0.34.1", default-features = false, features = ["accesskit", "android-game-activity", "android-native-activity", "default_fonts", "glow", "persistence", "wayland", "web_screen_reader", "wgpu", "wgpu_no_default_features", "x11"] }
default = accesskit, default_fonts, wayland, web_screen_reader, wgpu, x11

These default features are set whenever eframe is added without default-features = false somewhere in the dependency tree.

Enables winit

accesskit default

Enable platform accessibility API implementations through AccessKit.

Enables accesskit of egui-winit

Affects winit_integration::WinitApp.on_accesskit_event

android-game-activity

Allow crates to choose an android-activity backend via Winit

  • It's important that most applications should not have to depend on android-activity directly, and can rely on Winit to pull in a suitable version (unlike most Rust crates, any version conflicts won't link)
  • It's also important that we don't impose an android-activity backend by taking this choice away from applications.

Enable the game-activity backend via egui-winit on Android

Enables android-game-activity of egui-winit

android-native-activity

Enable the native-activity backend via egui-winit on Android

Enables android-native-activity of egui-winit

default_fonts default

If set, egui will use include_bytes! to bundle some fonts. If you plan on specifying your own fonts you may disable this feature.

Enables default_fonts of egui

glow

Enable glow for painting, via egui_glow.

There is generally no need to enable both the wgpu and glow features, but if you do you can pick the renderer to use with NativeOptions::renderer and WebOptions::renderer.

Enables egui_glow, glow, glutin, and glutin-winit

egui_glow:

Optional dependencies

Affects epi::CreationContext.gl, epi::CreationContext.get_proc_address, epi::App.on_exit, epi::NativeOptions.shader_version, epi::WebOptions.webgl_context_option, run::run_glow, run::create_glow, epi::EventLoopBuilderHook, epi::WindowBuilderHook, epi::NativeOptions.renderer, epi::NativeOptions.event_loop_builder, epi::NativeOptions.window_builder, epi::WebOptions.renderer, epi::Renderer, eframe::run_native, eframe::create_native, eframe::run_ui_native, eframe::run_simple_native

persistence = ron, serde

Enable saving app state to disk.

Enables home, persistence of egui, serde of egui-winit

Affects native::file_storage

wayland default

Enables wayland support and fixes clipboard issue.

If you are compiling for Linux (or want to test on a CI system using Linux), you should enable this feature.

Enables wayland of optional egui-wgpu, egui-winit, optional egui_glow, optional glutin, and optional glutin-winit

web_screen_reader default

Enable screen reader support (requires ctx.options_mut(|o| o.screen_reader = true);) on web.

For other platforms, use the accesskit feature instead.

Enables SpeechSynthesis and SpeechSynthesisUtterance of web-sys

Affects web::screen_reader

wgpu default = wgpu_no_default_features

Enable wgpu for painting (via egui-wgpu).

There is generally no need to enable both the wgpu and glow features, but if you do you can pick the renderer to use with NativeOptions::renderer and WebOptions::renderer.

Switching from wgpu (the default) to glow can significantly reduce your binary size (including the .wasm of a web app). See https://github.com/emilk/egui/issues/5889 for more details.

By default, eframe will prefer WebGPU over WebGL, but you can configure this at run-time with WebOptions::wgpu_options.

Enables egui-wgpu

wgpu_no_default_features wgpu

This is exactly like the wgpu feature, but does NOT enable the default features of wgpu and egui-wgpu.

This means that no wgpu backends are enabled. You will need to enable them yourself, e.g. like this:

wgpu = { version = "*", features = ["dx12", "metal", "webgl"] }

Enables egui-wgpu, pollster, and wgpu

Affects epi::CreationContext.wgpu_render_state, epi::NativeOptions.wgpu_options, epi::WebOptions.wgpu_options, epi::Frame.wgpu_render_state, run::run_wgpu, run::create_wgpu, epi::EventLoopBuilderHook, epi::WindowBuilderHook, epi::NativeOptions.renderer, epi::NativeOptions.event_loop_builder, epi::NativeOptions.window_builder, epi::WebOptions.renderer, epi::Renderer, eframe::run_native, eframe::create_native, eframe::run_ui_native, eframe::run_simple_native

x11 default

Enables compiling for x11.

Enables glx and x11 of optional glutin and optional glutin-winit, x11 of egui-winit, optional egui-wgpu, and optional egui_glow

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

ron persistence?

Affects epi::get_value, epi::set_value

serde persistence?