Skip to main content

Crate incular

Crate incular 

Source
Expand description

§Incular

Build

Build native desktop apps in Rust with a declarative, retained UI framework.

Incular combines composable widgets, reactive state, and a retained rendering pipeline. Describe your interface in Rust, connect it to application state, and let Incular update and render the parts that change. Its shared Winit desktop host and WGPU renderer run on Windows, Linux, and macOS.

§Architecture and support

ContractStatus
OwnershipFeature-controlled public facade and application preludes.
API classapplication; re-exports retain the defining API class under the architecture contract.
SupportRe-exports inherit original API classes; platform features are target-specific.

§What you can build

  • Reactive interfaces: Signal, Memo, Effect, and Action for state, derived values, side effects, and asynchronous operations.
  • Rich desktop UI: flexible layout, text and text editing, images, scrolling lists, forms, and custom canvas painting.
  • Interactive experiences: pointer gestures, keyboard input, focus management, transitions, and animation.
  • Accessible applications: platform-neutral semantics projected into native accessibility systems.
  • Layered design systems: neutral widgets with optional themed Controls and Material components.
  • Full application flows: routing, overlays, restoration, windows, and native desktop services.
  • Runtime diagnostics: opt-in instrumentation and a standalone DevTools application.

§A first window

use incular::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let app = Application::new(|_cx| {
        Container::builder()
            .padding(EdgeInsets::all(24.0))
            .alignment(Alignment::CENTER)
            .child(Text::new("Hello, Incular!"))
            .build()
            .into()
    })?;

    incular::run(app)?;
    Ok(())
}

§Try Incular

You’ll need Rust 1.89 or newer, a desktop environment, and a compatible GPU driver. Platform-specific setup is covered in the installation guide.

git clone https://github.com/FabortLabs/incular.git
cd incular
cargo run -p incular --example hello

The checkout includes a gallery of examples, from controls and animation to navigation and custom rendering.

§Documentation

§Feature flags

FeaturePurposeDefault
desktopNative desktop runner with every WGPU backendYes
desktop-hostNative desktop runner; pair it with at least one backend belowVia desktop
dx12, metal, vulkan, glWGPU backends; each enables desktop-host and is ignored where unavailableVia desktop
controlsThemed Incular controlsYes
materialMaterial presentation; enables controlsYes
devtoolsDiagnostics transport and runtime instrumentationNo
hot-reloadLive code patching in debug builds under dx serve --hot-patchNo

The main incular::prelude contains the neutral framework API. Import themed controls from incular::controls_prelude and Material components from incular::material_prelude.

§Contributing

Incular is actively developed and pre-1.0. Contributions and feedback are welcome; see the contribution guide, code of conduct, and security policy.

Licensed under Apache-2.0.

Re-exports§

pub use incular_accessibility as accessibility;
pub use incular_animation as animation;
pub use incular_assets as assets;
pub use incular_config as config;
pub use incular_controls as controls;
pub use incular_core as core;
pub use incular_gestures as gestures;
pub use incular_image as image;
pub use incular_layout as layout;
pub use incular_material as material;
pub use incular_navigation as navigation;
pub use incular_rendering as painting;
pub use incular_rendering as rendering;
pub use incular_runtime as runtime;
pub use incular_semantics as semantics;
pub use incular_text as text;
pub use incular_widgets as widgets;
pub use incular_platform as platform;
pub use incular_wgpu as wgpu;
pub use incular_linux as linux;

Modules§

controls_prelude
Opt-in Controls convenience imports. Controls stay separate from the base prelude so applications without the optional controls feature keep the renderer-neutral API surface.
material_prelude
Opt-in Material convenience imports. Material is intentionally not part of prelude so a base Widgets application cannot accidentally depend on a design system. Enable the material feature and import this module when using Material components.
prelude
Common application-facing types for the initial native UI slice.
reactive
Reactive values and owner-mounted asynchronous primitives. This namespace keeps reactive::Effect and reactive::Action distinct from Incular’s rendering and widget types with the same conventional names.
scroll
Public scrolling policies and notifications.
testing
High-level application testing tools. These drive Incular’s normalized input/event path in-process and capture rendered application frames without injecting OS input or capturing the desktop.

Constants§

PERFORMANCE_OVERLAY_KEY
Widget key that marks the performance-overlay mount point.

Functions§

install_performance_overlay
Installs the repaint-contained debug performance overlay into window. The tree must contain a placeholder keyed with PERFORMANCE_OVERLAY_KEY; publishing rebuilds only that element.
overlay_lines
Formats a snapshot into standard overlay lines (thin wrapper over incular_runtime::PerformanceSnapshot::overlay_lines).
run
Runs an application on the native backend selected by the compilation target.