Expand description
§Freya
Freya is a declarative, cross-platform GUI 🦀 Rust library, powered by 🎨 Skia.
New to Freya? Follow Building your first app to build and test a todo app.
§Example
use freya::prelude::*;
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_press(move |_| *count.write() += 1)
.child(format!("Click to increase -> {}", count.read()))
}§Basics
- UI and Components
- Elements
- Events
- Hooks
- State
- Context
- Global Contexts
- Async
- Fonts
- Layers
- Optimizing
- Platform Integration
- Platforms
- Android
- Web
- Development Setup
- Extending Components
- Custom Elements
- Working with AI
§Learn
- Building an app
- Built-in Components
- Built-in Components Gallery
- i18n
- Animation
- Routing
- Clipboard
- Icons
- Material Design
- Plotters
- Testing
- HTML Viewer
- Terminal
- Camera
- Video
- Freya Query
- Tokio Integration
- Borderless Windows
- Devtools
- Hot Reload
- HTTP Requests
§Features flags
all: Enables all the features listed belowwinit: Reexports freya_winit and enables the launch entrypoint. Enabled by default.gpu: Enables GPU rendering support. Enabled by default.accessibility: Enables the AccessKit accessibility backend for winit. Enabled by default.router: Reexport freya_router under routeri18n: Reexport freya_i18n under i18nremote-asset: Enables HTTP requests and remote sources for ImageViewer and GifViewer.tray: Enables system tray support through the tray module.sdk: Reexport freya_sdk under sdk.sdk-tokio: Enables the Tokio utilities from freya_sdk. Impliessdk.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 components fromfreya-components.icons: Reexport of freya_icons under icons.icons-lucide: Enables the Lucide icons from freya_icons. Impliesicons.radio: Reexport freya_radio under radio.query: Reexport freya_query under query.markdown: Reexport freya_markdown under markdown.html: Reexport freya_html under html.titlebar: Enables the TitlebarButton component.borderless: Reexport freya_borderless_plugin under borderless. See Borderless Windows.terminal: Reexport freya_terminal under terminal.terminal-pty: Enables the PTY backend from freya_terminal. Impliesterminal.code-editor: Reexport freya_code_editor under code_editor.camera: Reexport freya_camera under camera.web: Reexport freya_web under web.platform-text-gamma: Applies platform-specific text contrast and gamma on Linux and macOS. Enabled by default.
§Misc features
devtools: Enables devtools support.metrics: Reexports the metrics plugin. The plugin is auto-added in debug builds.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.
Re-exports§
pub use torin;
Modules§
- _docs
- Freya guides.
- animation
- Reexport
freya-animation. - borderless
borderless - Reexport
freya-borderless-pluginwhen theborderlessfeature is enabled. - 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.
- html
html - Reexport
freya-htmlwhen thehtmlfeature is enabled. - 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. - metrics
metrics - Reexport
freya-metrics-pluginwhen themetricsfeature 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. - web
web - Reexport
freya-webwhen thewebfeature is enabled and the target is the browser. - winit
winit - Reexport
winitwhen thewinitfeature is enabled.