waterui-core 0.1.0

Core functionality for the WaterUI framework
docs.rs failed to build waterui-core-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: waterui-core-0.2.0

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")),
];