waterui-core

Crates.iowaterui-core
lib.rswaterui-core
version0.1.0
created_at2025-09-07 14:21:58.43815+00
updated_at2025-09-07 14:21:58.43815+00
descriptionCore functionality for the WaterUI framework
homepage
repositoryhttps://github.com/water-rs/waterui
max_upload_size
id1828170
size86,187
Lexo Liu (lexoliu)

documentation

README

WaterUI Core

The foundational crate of the WaterUI framework, providing essential building blocks for developing cross-platform reactive user interfaces.

Overview

waterui-core establishes a unified architecture that works consistently across desktop, mobile, web, and embedded environments. It provides the core abstractions and systems that all other WaterUI components build upon.

Key Features

  • Declarative View System: Compose complex UIs from simple, reusable components
  • Environment-based Context: Type-safe dependency injection and configuration propagation
  • Type Erasure: AnyView enables heterogeneous collections of different view types
  • Plugin Architecture: Extensible system for adding framework capabilities
  • Animation System: Declarative animations with spring physics and transitions
  • Cross-platform: Consistent API across all supported platforms
  • No-std Compatible: Can be used in embedded environments

Core Concepts

View Trait

The foundation of all UI components:

pub trait View: 'static {
    fn body(self, env: &Environment) -> impl View;
}

Environment

Type-based dependency injection system:

let env = Environment::new()
    .with(Theme::Dark)
    .install(LocalizationPlugin::new("en_US"));

AnyView

Type-erased view container for dynamic composition:

let views: Vec<AnyView> = vec![
    AnyView::new(Text::new("Hello")),
    AnyView::new(Button::new("Click me")),
];
Commit count: 183

cargo fmt