Expand description
A declarative, cross-platform UI framework that uses native controls.
The API takes inspiration from contemporary reactive frameworks like SwiftUI, Xilem and React. A central design goal is to avoid using too much macro magic and instead heavily leverage associated types, traits and generics.
A simple hello world program in Nuit takes only a single line:
use nuit::Text;
nuit::run_app(Text::new("Hello world!"));
Macros§
- Clones values for capture in a closure.
Structs§
- A geometric angle.
- A pair of a getter and a setter, encapsulating a reference to some value.
- A widget that performs an action when pressed/tapped.
- A C/FFI-compatible wrapper around
Root<T>
. - A capsule shape.
- A circular shape.
- An RGBA color.
- A configuration encapsulating an app with its preferred backend.
- A convenience for building a
Config
. - A context used during rendering that tracks the path to the current view and holds a reference to internal storage.
- The difference between two values.
- An event emitted during a drag gesture.
- A gesture recognizing a drag.
- An elliptic shape.
- A shape that fills its content using a given style.
- A group of views that is dynamically computed from a given collection.
- A view recognizing a gesture.
- A view that lays out its children horizontally.
- A view that handles events using a provided closure.
- A borrowed path of ids.
- An owned path of ids.
- A value with an id.
- A conditional view that can take on one of at most two branches, depending on a boolean condition.
- Insets along each edge of a rectangle.
- A view that arranges its children in a stylized list.
- A view that applies a modifier.
- A view that lays out its children on top of each other.
- A view that lets the user choose a value.
- A rectangular shape.
- The central state of a Nuit application.
- A rectangular shape with rounded corners.
- A circular sector shape.
- A wrapper around a value managed by nuit.
- A key that uniquely identifies a value in a storage.
- A facility that manages view state internally.
- A shape that strokes its outline using a given style.
- A gesture recognizing a tap.
- A text label.
- A user-modifiable text field.
- A point in normalized 2D space ([0, 1] x [0, 1])
- A view that lays out its children vertically.
- A 2D vector (or position).
- A view that lays out its children on top of each other.
Enums§
- A 2D alignment.
- An animation to use for smooth view transitions.
- The curve of a simple animation.
- A UI backend.
- A UI event.
- An abstract/platform-dependent font.
- Geometry for a view.
- A gesture-related UI event.
- A rendered gesture tree.
- An identifier for a view.
- A stylized, platform-specific background.
- A rendered modifier.
- A gesture type that can never be constructed.
- A shape type that can never be constructed.
- A view type that can never be constructed.
- A rendered UI component tree.
- A rendered shape tree.
- A color or pattern for filling or stroking.
Constants§
Traits§
- A trait for approximate equality.
- Binds a storage to the view’s state.
- A type that can be diffed in terms of id paths.
- A composable gesture.
- An identifiable value.
- An extension trait for conveniently creating
Identified
values. - A composable shape component.
- An extension trait with various convenience methods for shapes.
- The primary view trait. Represents a lightweight UI component.
- An extension trait with various convenience methods for views.
- A type that has a zero value.
Functions§
- Blocks and presents the given view to the user.