Yororen UI
Features
Quick Start
1) Register Components
Some components require one-time registration/initialization. Call component::init during app startup:
use App;
use component;
2) Install the Global Theme
Yororen UI provides a GlobalTheme that selects light/dark palettes based on WindowAppearance.
use App;
use GlobalTheme;
Inside render functions you can access theme colors via ActiveTheme:
use ;
use ActiveTheme;
// in render(..., cx: &mut gpui::Context<Self>)
let theme = cx.theme;
let _ = div.bg.text_color;
2.5) Install i18n (Locale + RTL)
Yororen UI ships with an embedded JSON translation loader under locales/*.json.
Initialize I18n during app startup:
use App;
use ;
To preview RTL, switch the locale:
cx.set_global;
3) Provide Assets (Icons)
This crate embeds its icons under assets/icons/** and exposes them as a gpui::AssetSource (yororen_ui::assets::UiAsset).
If your app only needs Yororen UI's icons, you can install them directly:
use Application;
use UiAsset;
let app = new.with_assets;
If your app has its own assets too, compose asset sources so both sets are available. Yororen UI includes a small helper CompositeAssetSource:
use Application;
use ;
// `MyAsset` is your own AssetSource implementation
let app = new.with_assets;
Important: Your primary AssetSource should return Ok(None) when a path doesn't exist. If it returns an error on missing paths, it can prevent fallback to UiAsset.
Demo Applications
We provide four official demo applications to help you get started:
| Demo | Description | Run Command |
|---|---|---|
| Counter | Minimal counter app - perfect for learning basics | cd demo/counter && cargo run |
| TodoList | Todo app template - ideal for building full apps | cd demo/todolist && cargo run |
| File Browser | File browser with tree structure | cd demo/file_browser && cargo run |
| Toast Notification | Toast notification showcase | cd demo/toast_notification && cargo run |
Counter
A minimal counter application demonstrating the most fundamental Yororen UI concepts.
Key Features:
- Simple global state management (
Arc<Mutex<T>>) - Button click event handling (
on_click) - Reactive UI updates (
cx.notify())
Best For: Developers new to Yororen UI as their first learning example.
TodoList
A todo list application template demonstrating standard patterns and best practices for building complete Yororen UI applications.
Key Features:
- Application bootstrap pattern
- Modular architecture (state, components, models)
- Global state management
- CRUD operations (create, read, update, delete todo items)
Best For: Developers building production applications, serving as a starter template.
File Browser
A fully functional file browser demo showing how to render and interact with complex hierarchical data structures.
Key Features:
- Directory tree (
Tree+TreeItem): Display file system hierarchy - Icons: File and folder icon display
- Empty state: Friendly message when no content
- Context menu: Right-click menu for copy/paste operations
Best For: Scenarios requiring tree structures, file managers, or any hierarchical data display.
Toast Notification
Demonstrates the Toast notification component with various styles and usage patterns.
Key Features:
- Multiple Toast types: Success, Warning, Error, Info, Neutral
- Notification queue management (
NotificationCenter) - Interactive notifications (with action buttons)
- Custom notification content
- Different dismissal strategies (auto-dismiss/manual)
Best For: Applications that need to provide immediate feedback to users.
Built with Yororen UI
Projects and applications built using Yororen UI.
Yororen Accelerator
A network acceleration tool with native-transparent TCP forwarding + relay passthrough, built with Yororen UI.
Key Highlights:
- Complex dashboard with real-time statistics
- Custom window chrome with native-like experience
- Rich data tables and virtualized lists
- Server management and configuration UI
What's Inside
Modules
Component Overview
Icons
The component icon API uses strongly-typed names:
use ;
let _ = icon;
Icon paths map to embedded SVG assets like icons/minecraft.svg.
Requirements
Installation
From crates.io (recommended)
[]
= "0.2"
From GitHub (latest development)
[]
= { = "https://github.com/MeowLynxSea/yororen-ui.git", = "v0.2.0" }
From a local path (development)
[]
= { = "../yororen-ui" }
Dependencies
gpui-ce is distributed via crates.io with semantic versioning. Make sure your application uses a compatible version:
[]
= { = "gpui-ce", = "0.3" }
In this repository, gpui-ce is specified in Cargo.toml.
License
See NOTICE for attribution details.
Contributing
Issues and PRs are welcome.
When changing visuals:
Wiki
See Yororen UI Wiki for detailed documentation, guides, and component references.