Skip to main content

Installation

This guide will help you set up everything needed to start building applications with Freya.

Prerequisites

Make sure you have Rust installed. If you don’t have it yet, visit rustup.rs to install the Rust toolchain.

Platform-Specific Setup

Windows Requirements

Install Visual Studio 2022 with the “Desktop Development with C++” workflow.
1

Download Visual Studio 2022

Download the Visual Studio 2022 Community Edition installer.
2

Install C++ Development Tools

During installation, select the “Desktop Development with C++” workload. This includes:
  • MSVC C++ compiler
  • Windows SDK
  • CMake tools
3

Verify Installation

Open a new terminal and verify your Rust installation:
rustc --version
cargo --version
If you’re using windows-gnu toolchain and encounter compile errors, check this issue for potential solutions.

Creating a New Project

Once you have the platform dependencies installed, create a new Rust project:
1

Create a new binary project

cargo new my-freya-app
cd my-freya-app
2

Add Freya as a dependency

Add Freya to your Cargo.toml:
[dependencies]
freya = "0.4.0-rc.11"
The main branch contains the latest features but may have breaking changes. Use stable releases for production applications.
3

Write your first app

Replace the contents of src/main.rs with:
#![cfg_attr(
    all(not(debug_assertions), target_os = "windows"),
    windows_subsystem = "windows"
)]

use freya::prelude::*;

fn main() {
    launch(LaunchConfig::new().with_window(WindowConfig::new(app)))
}

fn app() -> impl IntoElement {
    rect()
        .center()
        .expanded()
        .child("Hello, Freya!")
}
4

Run your application

cargo run
You should see a window with “Hello, Freya!” displayed in the center.

Optional Features

Freya supports optional features that you can enable based on your needs:
[dependencies]
freya = { version = "0.4.0-rc.11", features = ["router", "i18n", "icons"] }
  • router - Type-safe routing with freya-router
  • i18n - Internationalization support with Fluent
  • icons - Icon library (Lucide icons)
  • radio - Global state management with freya-radio
  • sdk - Additional utilities and integrations
  • material-design - Material Design components and effects
  • webview - Embed web content in your app
  • terminal - Terminal emulation support
  • code-editor - Code editor with syntax highlighting
  • plot - Charting and data visualization with Plotters
  • calendar - Calendar component
  • markdown - Markdown rendering
  • gif - GIF animation support
  • devtools - Developer tools for debugging
  • performance - Performance monitoring
  • all - Enable all features (except devtools)

Known Issues

Custom Linkers: The following custom linkers are currently not supported:
  • mold
If you encounter issues with other linkers, please report them.

Testing Your Setup

To verify everything is working correctly, try running one of the examples from the Freya repository:
# Clone the repository
git clone https://github.com/marc2332/freya
cd freya

# Initialize submodules (required)
git submodule update --init --recursive

# Run the counter example
cargo run --example counter
If the counter example runs successfully, your environment is ready for development!

Next Steps

Quick Start Tutorial

Build your first interactive app with our step-by-step guide

Browse Examples

Explore 100+ examples covering all features

Getting Help

If you encounter any issues during installation:

Build docs developers (and LLMs) love