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§
- assert_
approx_ eq - clone
- Clones values for capture in a closure.
Structs§
- Angle
- A geometric angle.
- Binding
- A pair of a getter and a setter, encapsulating a reference to some value.
- Button
- A widget that performs an action when pressed/tapped.
- CRoot
- A C/FFI-compatible wrapper around
Root<T>
. - Capsule
- A capsule shape.
- Circle
- A circular shape.
- Color
- An RGBA color.
- Config
- A configuration encapsulating an app with its preferred backend.
- Config
Builder - A convenience for building a
Config
. - Context
- A context used during rendering that tracks the path to the current view and holds a reference to internal storage.
- Difference
- The difference between two values.
- Drag
Event - An event emitted during a drag gesture.
- Drag
Gesture - A gesture recognizing a drag.
- Ellipse
- An elliptic shape.
- Fill
- A shape that fills its content using a given style.
- ForEach
- A group of views that is dynamically computed from a given collection.
- Gestured
- A view recognizing a gesture.
- HStack
- A view that lays out its children horizontally.
- Handler
- A view that handles events using a provided closure.
- IdPath
- A borrowed path of ids.
- IdPath
Buf - An owned path of ids.
- Identified
- A value with an id.
- If
- A conditional view that can take on one of at most two branches, depending on a boolean condition.
- Insets
- Insets along each edge of a rectangle.
- List
- A view that arranges its children in a stylized list.
- Modified
- A view that applies a modifier.
- Overlay
- A view that lays out its children on top of each other.
- Picker
- A view that lets the user choose a value.
- Rectangle
- A rectangular shape.
- Root
- The central state of a Nuit application.
- Rounded
Rectangle - A rectangular shape with rounded corners.
- Sector
- A circular sector shape.
- State
- A wrapper around a value managed by nuit.
- State
Key - A key that uniquely identifies a value in a storage.
- Storage
- A facility that manages view state internally.
- Stroke
- A shape that strokes its outline using a given style.
- TapGesture
- A gesture recognizing a tap.
- Text
- A text label.
- Text
Field - A user-modifiable text field.
- Unit
Point - A point in normalized 2D space ([0, 1] x [0, 1])
- Update
- VStack
- A view that lays out its children vertically.
- Vec2
- A 2D vector (or position).
- ZStack
- A view that lays out its children on top of each other.
Enums§
- Alignment
- A 2D alignment.
- Animation
- An animation to use for smooth view transitions.
- Animation
Curve - The curve of a simple animation.
- Backend
- A UI backend.
- Drag
Event Kind - Event
- A UI event.
- Font
- An abstract/platform-dependent font.
- Font
Design - Font
Level - Font
Size - Font
Weight - Frame
- Geometry for a view.
- Gesture
Event - A gesture-related UI event.
- Gesture
Node - A rendered gesture tree.
- Id
- An identifier for a view.
- Material
- A stylized, platform-specific background.
- Modifier
Node - A rendered modifier.
- Never
Gesture - A gesture type that can never be constructed.
- Never
Shape - A shape type that can never be constructed.
- Never
View - A view type that can never be constructed.
- Node
- A rendered UI component tree.
- Shape
Node - A rendered shape tree.
- Style
- A color or pattern for filling or stroking.
Constants§
Traits§
- Approx
Eq - A trait for approximate equality.
- Bind
- Binds a storage to the view’s state.
- Diff
- A type that can be diffed in terms of id paths.
- Gesture
- A composable gesture.
- HasId
- An identifiable value.
- Identify
Ext - An extension trait for conveniently creating
Identified
values. - Shape
- A composable shape component.
- Shape
Ext - An extension trait with various convenience methods for shapes.
- View
- The primary view trait. Represents a lightweight UI component.
- ViewExt
- An extension trait with various convenience methods for views.
- Zero
- A type that has a zero value.
Functions§
- nuit_
c_ string_ drop - run_app
- Blocks and presents the given view to the user.