Expand description
§Freya
Freya is a declarative, cross-platform GUI 🦀 Rust library, powered by 🎨 Skia.
§Example
fn main() {
// *Start* your app with a window and its root component
launch(LaunchConfig::new().with_window(WindowConfig::new(app)))
}
fn app() -> impl IntoElement {
// Define a reactive *state*
let mut count = use_state(|| 0);
// Declare the *UI*
rect()
.width(Size::fill())
.height(Size::fill())
.background((35, 35, 35))
.color(Color::WHITE)
.padding(Gaps::new_all(12.))
.on_mouse_up(move |_| *count.write() += 1)
.child(format!("Click to increase -> {}", count.read()))
}§Basics
- UI and Components
- Elements
- Events
- Hooks
- State
- Async
- Layers
- Platforms
- Development Setup
- Extending Components
§Learn
- Built-in Components
- Built-in Components Gallery
- i18n
- Animation
- Routing
- Clipboard
- Icons
- Material Design
- Plotters
- Testing
- WebView
- Terminal
- Camera
- Video
- Freya Query
- Tokio Integration
- Devtools
- Hot Reload
§Features flags
all: Enables all the features listed belowwinit: Reexports freya_winit and enables the launch entrypoint. Enabled by default.router: Reexport freya_router under routeri18n: Reexport freya_i18n under i18nremote-asset: Enables support for HTTP asset sources for ImageViewer and GifViewer components.tray: Enables tray support using the tray_icon crate.sdk: Reexport freya_sdk under sdk.gif: Enables the GifViewer component.video: Reexport freya_video under video.plot: Reexport of plotters under plot.material-design: Reexport freya_material_design under material_design.calendar: Enables the Calendar component.icons: Reexport of freya_icons under icons.radio: Reexport freya_radio under radio.query: Reexport freya_query under query.markdown: Reexport freya_markdown under markdown.webview: Reexport freya_webview under webview.titlebar: Enables the TitlebarButton component.terminal: Reexport freya_terminal under terminal.code-editor: Reexport freya_code_editor under code_editor.camera: Reexport freya_camera under camera.
§Misc features
devtools: Enables devtools support.performance: Reexports the performance overlay plugin. The plugin is auto-added in debug builds.vulkan: Enables Vulkan rendering support.hotpath: Enables Freya’s internal usage of hotpath.hotreload: Enables hot reload support via thedxCLI fromdioxus-cli. See Hot Reload.zoom-shortcuts: EnablesCtrl/Cmd++/-/0to zoom the app.
Modules§
- _docs
- Freya guides.
- animation
- Reexport
freya-animation. - camera
camera - Reexport
freya-camerawhen thecamerafeature is enabled. - clipboard
- Reexport
freya-clipboard. - code_
editor code-editor - Reexport
freya-code-editorwhen thecode-editorfeature is enabled. - components
- Built-in components like
Button,InputorScrollView. - elements
- Built-in elements like
rect,labelorparagraph. - engine
engine - Reexport
freya-enginewhen theenginefeature is enabled. - helpers
- Helpers to build elements out of plain functions.
- i18n
i18n - Reexport
freya-i18nwhen thei18nfeature is enabled. - icons
icons - Reexport
freya-iconswhen theiconsfeature is enabled. - markdown
markdown - Reexport
freya-markdownwhen themarkdownfeature is enabled. - material_
design material-design - Reexport
freya-material-designwhen thematerial-designfeature is enabled. - performance
performance - Reexport
freya-performance-pluginwhen theperformancefeature is enabled. - plot
plot - Reexport
freya-plotters-backendandplotterswhen theplotfeature is enabled. - prelude
- Common imports to build Freya apps, use it with
use freya::prelude::*;. - query
query - Reexport
freya-querywhen thequeryfeature is enabled. - radio
radio - Reexport
freya-radiowhen theradiofeature is enabled. - router
router - Reexport
freya-routerwhen therouterfeature is enabled. - sdk
sdk - Reexport
freya-sdkwhen thesdkfeature is enabled. - terminal
terminal - Reexport
freya-terminalwhen theterminalfeature is enabled. - text_
edit - Reexport
freya-edit, the text editing APIs. - tray
tray - Reexport
tray-iconwhen thetrayfeature is enabled. - video
video - Reexport
freya-videowhen thevideofeature is enabled. - webview
webview - Reexport
freya-webviewwhen thewebviewfeature is enabled. - winit
winit - Reexport
winitwhen thewinitfeature is enabled.