Cross-platform and non-web GUI library for Rust powered by Skia.
Cross-platform and non-web GUI library for Rust powered by Skia.
Website | Documentation | Discord | Contact
Freya is a cross-platform, native, declarative GUI library for Rust .
Latest stable release:
freya = "0.4"Next release:
freya = "0.5.0-rc.6"main branch:
freya = { git = "https://github.com/marc2332/freya", branch = "main" }Make sure to have Development Setup ready.
⚠️ This repo uses git submodules, cloning without
--recurse-submoduleswill make the examples fail to compile.
git clone --recurse-submodules https://github.com/marc2332/freya.git
cd freyaAlready cloned without submodules? Run
git submodule update --init --recursiveto fetch them.
Then run an example:
cargo run --example counter⚠️ If you happen to be on Windows using
windows-gnuand get compile errors, maybe go check this issue.
Freya’s component model lets you create reusable UI elements that automatically re-render when the state they depend on changes. Components can hold their own internal state or subscribe to shared state, and they produce UI as their output. Any type that implements the Component trait can be a component, while the root (app) component can simply be a function. Built-in examples include components like Button and Switch.
|
Freya comes with a set of components out of the box, from simple like Button, Switch, Slider to more complex like VirtualScrollView, Calendar, ColorPicker, etc.
You can check all the examples that start with component_ in the examples folder.
Example of component_input.rs:
Create transitions for colors, sizes, positions, and other visual properties. The animation API gives you full control over timing, easing functions, and animation sequences.
Code…Freya provides text editing capabilities that go beyond simple input fields. You can create rich text editors with cursor management, text selection, keyboard shortcuts, custom formatting, virtulization and more.
Code…Create and control text Code Editors. It is state agnostic so as long as it can be turned into a Writable it will work. Uses Rope for text editing and tree-sitter for syntax highlighting. You bring your own tree-sitter grammar and its highlights query, so any language can be supported.
Enable with the code-editor feature.
…Render Markdown documents with the MarkdownViewer component.
Enable with the markdown feature.
fn app() -> impl IntoElement {
MarkdownViewer::new("# Hello World\n\nThis is **bold** and *italic* text.")
}Define routes, manage navigation state, and transition between different views.
Enable with the router feature.
…Freya's freya-radio state management system provides efficient global state management through a channels system. Components subscribe to specific "channels" and only receive updates when data is mutated and notified through their channel.
Enable with the radio feature.
…Easily integrate icons into your applications, only supports Lucide at the moment.
Codeuse freya::prelude::*;
use freya::icons;
fn app() -> impl IntoElement {
SvgViewer::new(icons::lucide::antenna())
.color((120, 50, 255))
.expanded()
}Using freya-testing you can test your Freya components in a no-window (headless) environment. You can decide to render the app at any moment to a file though. freya-testing is actually used by Freya itself to test all the out of the box components and other APIs.
…Using the Plotters library, you can create charts, graphs, and data visualizations directly within your application.
Enable with the ploters feature.
…Freya supports internationalization with built-in support for the Fluent localization system. Easily manage translations, pluralization, and locale-specific formatting.
Enable with the i18n feature.
…Freya provides Material Design-inspired style modifiers.
Enable with the material-design feature.
use freya::prelude::*;
use freya::material_design::*;
fn app() -> impl IntoElement {
rect().center().expanded().child(
Button::new()
.on_press(|_| println!("Material button pressed"))
.ripple() // Adds Material Design ripple effect
.child("Material Button"),
)
}Integrate web content into your native applications with Freya's WebView support. Embed web applications, or simply display web-based content alongside your native UI components.
Enable with the webview feature.
…Freya includes terminal emulation capabilities with full PTY (pseudo-terminal) support. Create integrated terminal applications, SSH clients, or development tools.
Enable with the terminal-pty feature.
…Examine the component tree in real-time.
Enable the devtools feature in freya and then run the devtools app.
If you are interested in contributing please make sure to have read the Contributing guide first!
You may contact me for questions, collaboration or anything that comes to your mind at [email protected].
If you are interested in supporting the development of this project feel free to donate to my Github Sponsor page.
Thanks to my sponsors for supporting this project!
calc() function and also pushed for improvements in the animation APIs.Freya 0.1, 0.2 and 0.3 were based on the core crates of Dioxus. Starting 0.4 Freya does no longer use Dioxus, instead it uses its own reactive core, partially inspired by Dioxus but yet with lots of differences.
A Claude Code skill with Freya best practices and patterns is available. Install it with:
/plugin marketplace add marc2332/freya
/plugin install freya@freya-marketplaceFor other AI coding agents, you can use the skill document directly as context: plugins/freya/skills/freya/SKILL.md
No open issues yet, or sync has not completed.