Skip to content

Introduction

Build native Rust interfaces with reusable .iru components.

On this page

Inrux is an experimental GUI framework for Rust. You describe a component in a .iru file and use Rust for its state and behavior. Cargo compiles the component into your native application. The <rust> block initializes each component instance: declare typed state directly there, and the compiler generates State and setup internally.

You can choose egui, Masonry or GPUI as the native backend. Inrux keeps application components, styling and state above an adapter boundary so you can change the selected backend and rebuild compatible applications.

You can use <rust explicit> when you want to write State and its setup function yourself. In either form, views can bind retained names such as count or counter.count directly. Complete direct value bindings read Signal and Computed values; Rust handlers still receive explicit state parameters. Read the .iru format for both forms.

Start with a working app

Follow installation, then run one of the playgrounds. Each playground shows the same 21 portable components, models, themes and integration examples.

If you want your own project, follow your first application. You need Rust and your operating system's native build tools. You do not need Node.js to build an Inrux application; Node is for this website and the editor extension.

Learn the component format

A .iru file contains <view>, <rust> and optional <style> blocks. The view describes the UI tree. The Rust block defines local state, imports and handlers. Styles change the component's appearance.

We chose .iru over a separate XML or layout file to keep a component's structure, local state and event bindings together. You can see what the component does and how its controls connect without switching files. You can still write handlers, business rules and services in ordinary .rs modules or Cargo libraries and import them from <rust>. Rust helpers can also build Node descriptions. See separating business logic for an example.

App.iru
<view>
    <Text text="Hello, Inrux" />
</view>
<rust>
use inrux::prelude::*;
pub struct Props;
</rust>

This example illustrates a stateless component. Use the scaffold's stateful root when mounting an application. Read the .iru format for a complete root example and the reasons for using SFCs.

Choose your next topic

Inrux stands for Igris Native Rust UI eXperience. You can read the source and report issues on GitHub.

Inrux · Built with Nuxt Content, IPEX, and Akaza UI.