About this project
Freya is a cross-platform, native, declarative GUI library for Rust. It targets developers building desktop applications in Rust who want a component-based UI model without relying on web technologies.
Core model: components are reusable UI elements that re-render when the state they depend on changes. Components can hold internal state or subscribe to shared state, and any type implementing the Component trait can act as a component; the root app component can be a plain function. Built-in examples include Button and Switch.
Out-of-the-box components range from simple controls such as Button, Switch and Slider to more complex ones like VirtualScrollView, Calendar and ColorPicker. Example files prefixed with component_ in the examples folder demonstrate them.
Feature areas described in the README:
- Animations: transitions for colors, sizes and positions, with control over timing, easing and sequences.
- Rich text editing: cursor management, selection, keyboard shortcuts, custom formatting and virtualization.
- Code editor: state-agnostic editor using Rope for text and tree-sitter for syntax highlighting; you supply the grammar and highlights query. Enabled via the code-editor feature.
- Markdown rendering via the MarkdownViewer component (markdown feature).
- Routing and navigation with a Routable derive, layouts, links and router context (router feature).
- Global state management through freya-radio, a channel-based system where components subscribe to channels and receive updates only when relevant data changes (radio feature).
- Icon library integration, currently supporting Lucide.
- Headless testing with freya-testing, which can simulate interactions and render UI state to files; used by Freya itself for testing built-in components.
- Charts and plotting via the Plotters library (ploters feature).
- Internationalization using the Fluent localization system, with translations, pluralization and locale switching (i18n feature).
- Material Design-inspired style modifiers such as ripple effects (material-design feature).
- WebView integration for embedding web content alongside native UI (webview feature).
- Terminal emulation with PTY support for integrated terminals or SSH clients (terminal-pty feature).
- Developer tools to inspect the component tree in real time (devtools feature).
Usage: the latest stable release is specified as freya = "0.4", with a 0.5.0-rc.7 pre-release and a main-branch option. The repository uses git submodules, so cloning requires --recurse-submodules or a later git submodule update --init --recursive. Examples can be run with cargo run --example counter. A development setup guide is linked from the docs. The README notes a possible compile issue on Windows with windows-gnu.
The project links a website, docs.rs documentation, a Discord server, contribution guidelines and a sponsorship page, and credits Dioxus, rust-skia and other contributors.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.