Skip to main content
Freya provides a comprehensive set of built-in components that make it easy to build beautiful and functional user interfaces. All components are designed with accessibility, theming, and performance in mind.

Form Controls

Button

Interactive button component with multiple style variants

Input

Text input field with validation and different modes

Checkbox

Checkbox for boolean selections

Switch

Toggle switch for binary on/off states

Slider

Slider for selecting numeric values from a range

Data Display

Table

Display tabular data with sortable columns

ScrollView

Scrollable container with virtual scrolling support

Date & Color

Calendar

Date picker with month/year navigation

ColorPicker

HSV-based color picker with gradient interface

Media & Graphics

ImageViewer

Display images from URLs, paths, or embedded bytes

Canvas

Custom drawing area with direct rendering access

Component Features

All Freya components share common features:
  • Theming: Customize appearance using theme props
  • Accessibility: Built-in ARIA roles and keyboard navigation
  • Reactive: Automatic updates when state changes
  • Performant: Optimized rendering and diffing
  • Type-safe: Full Rust type safety

Usage Pattern

Components in Freya follow a builder pattern:
use freya::prelude::*;

fn app() -> impl IntoElement {
    Button::new()
        .on_press(|_| println!("Clicked!"))
        .filled()
        .child("Click me")
}
Most components support:
  • Method chaining for configuration
  • State management via use_state
  • Event handlers like on_press, on_change
  • Layout properties like width(), height()
  • Styling variants like filled(), outline()

Build docs developers (and LLMs) love