Expand description
microui-redux provides an immediate-mode GUI toolkit inspired by rxi/microui.
The crate exposes the core context, container, layout, and renderer hooks necessary to embed a UI inside
custom render backends while remaining allocator- and platform-agnostic.
Built-in widget placement is driven by each widget’s preferred_size, so auto-sized rows can use
per-widget intrinsic text/icon metrics instead of a single shared control size.
Layout internals are flow-based: row tracks and vertical stack flows both run through the same
engine so scope/scroll/content bookkeeping stays consistent.
Modules§
- basis
- Coordinate basis and reference frame utilities.
- builder
- Helpers for constructing atlas textures at build time.
- matrix
- Matrix mathematics module providing 2x2, 3x3, and 4x4 matrices.
- primitives
- Geometric primitives for 3D graphics and collision detection.
- quaternion
- Quaternion operations and conversions. Quaternion math for rotations and orientation.
- queries
- Intersection and distance query traits and helpers. Intersection and distance query traits and implementations.
- scalar
- Scalar trait definitions for generic numeric operations.
- transforms
- 3D transformation functions for computer graphics.
- vector
- Vector mathematics module providing 2D, 3D, and 4D vector operations.
Structs§
- Atlas
Handle - Shared handle exposing read/write access to the atlas.
- Atlas
Source - Serializable representation of an atlas that can be shipped with the binary.
- Basis
- A 3D coordinate basis (reference frame).
- Box3
- A 3D axis-aligned bounding box (AABB).
- Button
- Persistent state for button widgets.
- Canvas
- High-level drawing helper that batches draw commands for a renderer.
- Char
Entry - Metrics and atlas coordinates for a glyph.
- Checkbox
- Persistent state for checkbox widgets.
- Color
- Simple RGBA color stored with 8-bit components.
- Combo
- Persistent state used by
combo_boxto track popup and selection. - Config
- Describes size and padding requirements of rectangle packing.
- Container
- Core UI building block that records commands and hosts layouts.
- Container
Handle - Shared handle to a container that can be embedded inside windows or panels.
- Container
Option - Options that control how a container behaves.
- Container
View - Read-only view into a container borrowed from a handle.
- Container
View Mut - Mutable view into a container borrowed from a handle.
- Context
- Primary entry point used to drive the UI over a renderer implementation.
- Control
State - Captures the interaction state for a widget during the current frame.
Produced by
Container::update_controland passed intoWidget::handle. - Custom
- Persistent state for custom render widgets.
- Custom
Render Args - Arguments forwarded to custom rendering callbacks.
- Dense
Packer - Similar to
Packerbut does not add any padding between rectangles. - Dimension
- A 2D dimension with width and height.
- File
Dialog State - Simple modal dialog that lets the user browse and pick files.
- Font
Entry - Describes a font baked into an
AtlasSource. - FontId
- Handle referencing a font stored in the atlas.
- IconId
- Handle referencing a bitmap icon stored in the atlas.
- Id
- Numeric identifier value.
- Input
- Aggregates raw input collected during the current frame.
- Input
Snapshot - Snapshot of the per-frame input state for widgets that need it.
- Internal
- Persistent state for internal window/container controls.
- KeyCode
- Logical navigation keys handled by the UI.
- KeyMode
- Modifier key state tracked by the input system.
- Line
- An infinite line in 2D or 3D space.
- ListBox
- Persistent state for list boxes.
- List
Item - Persistent state for list items.
- Matrix2
- A 2x2 matrix stored in column-major order.
- Matrix3
- A 3x3 matrix stored in column-major order.
- Matrix4
- A 4x4 matrix stored in column-major order.
- Mouse
Button - Mouse button state as reported by the input system.
- Node
- Persistent state for headers and tree nodes.
- Number
- Persistent state for number input widgets.
- Number
Edit State - Editing buffer for number-style widgets.
- Packer
Packeris the main structure in this crate. It holds packing context.- Parametric
Plane - A parametric plane defined by center and axis vectors.
- Plane
- A plane defined by ax + by + cz + d = 0.
- Quat
- A quaternion representing rotation or orientation.
- Ray
- A ray with an origin and direction.
- Rect
- A 2D axis-aligned rectangle.
- Renderer
Handle - Thread-safe handle that shares ownership of a
Renderer. - Resource
State - State bits returned by widgets to describe their interaction outcome.
- Segment
- A line segment with defined start and end points.
- Slider
- Persistent state for slider widgets.
- SlotId
- Handle referencing an arbitrary image slot stored in the atlas.
- Sphere3
- A sphere defined by center and radius.
- Style
- Collection of visual constants that drive widget appearance.
- Text
Area - Persistent state for multi-line text area widgets.
- Textbox
- Persistent state for textbox widgets.
- Texture
Id - Handle referencing a renderer-owned texture.
- Tri3
- A triangle defined by three vertices.
- Vector2
- A 2D vector with x and y components.
- Vector3
- A 3D vector with x, y, and z components.
- Vector4
- A 4D vector with x, y, z, and w components.
- Vertex
- Vertex submitted by the UI.
- Widget
Ctx - Shared context passed to widget handlers.
- Widget
Fill Option - Controls which widget states should draw a filled background.
- Widget
Option - Widget specific options that influence layout and interactivity.
- Window
Handle - Reference-counted handle to the internal window object.
Enums§
- Basis
Plane - Represents one of the three coordinate planes.
- Button
Content - Describes the content rendered inside a button widget.
- Clip
- Describes whether a rectangle is clipped by the current scissor.
- Control
Color - Identifiers for each of the built-in style colors.
- Image
- Either a slot stored inside the atlas or a standalone texture.
- Image
Source - Describes image bytes that can be uploaded to a texture.
- Input
Button State - Tracks input button transitions seen since the previous frame.
- Mouse
Event - Records the latest pointer interaction that occurred over a widget.
- Node
State Value - Expansion state used by tree nodes, headers, and similar widgets.
- Size
Policy - Describes how a layout dimension should be resolved. Size policy used by rows and columns when resolving cells.
- Source
Format - Encodes how atlas pixel data is stored.
- Stack
Direction - Direction used by stack flows when emitting vertical cells.
- Text
Wrap - Controls how text should wrap when rendered inside a container.
- Widget
Behaviour Option - Behaviour options that control how widgets and containers handle input side effects.
- Window
State - Indicates whether a window should be rendered this frame.
Constants§
- CHECK_
ICON - Identifier of the checkbox icon baked into the default atlas.
- CLOSED_
FOLDER_ 16_ ICON - Identifier of the closed-folder icon baked into the default atlas.
- CLOSE_
ICON - Identifier of the close icon baked into the default atlas.
- COLLAPSE_
ICON - Identifier of the collapse icon baked into the default atlas.
- EPS_F32
- Default epsilon for f32 comparisons.
- EPS_F64
- Default epsilon for f64 comparisons.
- EXPAND_
DOWN_ ICON - Identifier of the combo-box expand icon baked into the default atlas.
- EXPAND_
ICON - Identifier of the expand icon baked into the default atlas.
- FILE_
16_ ICON - Identifier of the file icon baked into the default atlas.
- OPEN_
FOLDER_ 16_ ICON - Identifier of the open-folder icon baked into the default atlas.
- WHITE_
ICON - Identifier of the solid white icon baked into the default atlas.
Traits§
- Cross
Product - Trait for computing the cross product of 3D vectors.
- Distance
- Query Traits
- Float
Scalar - Trait for floating-point scalars with transcendental functions.
- Float
Vector - Trait for vectors with floating-point components.
- Font
- Describes the interface the atlas uses to query font metadata.
- Intersect
- Trait for boolean intersection tests.
- Intersection
- Trait for producing intersection results.
- Rect
Trait - Simplified rectangle interface required by the packer implementations.
- Renderer
- Trait implemented by render backends used by the UI context.
- Scalar
- Core scalar trait for numeric types used in the library.
- Swizzle2
- Trait for 2D swizzle operations on vectors.
- Swizzle3
- Trait for 3D swizzle operations on vectors.
- Vector
- Generic vector trait defining common vector operations.
- Widget
- Trait implemented by persistent widget state structures.
handleis invoked with aWidgetCtxand precomputedControlState.
Functions§
- basis_
from_ unit - Building an Orthonormal Basis from a Unit Vector John. F. Hughes & Thomas Moller Journal of Graphics Tools, 4:4, 33-35 (DOI: 10.1080/10867651.1999.10487513)
- color
- Convenience constructor for
Color. - color4b
- Creates an RGBA color from byte components.
- decompose
- Decomposes a transformation matrix into scale, rotation, and translation.
- expand_
rect - Expands (or shrinks) a rectangle uniformly on all sides.
- frustum
- Creates a perspective projection matrix from frustum bounds.
- load_
image_ bytes - Decodes image data into 32-bit pixels according to
source. Grayscale and RGB PNG inputs are expanded to opaque RGBA (alpha = 255). - lookat
- Creates a view matrix looking from eye position to target.
- ortho4
- Creates an orthographic projection matrix.
- perspective
- Creates a perspective projection matrix.
- project3
- Projects a 3D point to screen coordinates.
- quad_
normal - Computes the normal vector of a quadrilateral.
- rect
- Convenience constructor for
Recti. - rotation_
from_ axis_ angle - Creates a 4x4 rotation matrix from an axis and angle.
- rotation_
from_ quat - Creates a 4x4 rotation matrix from a quaternion.
- scale
- Creates a 4x4 scaling matrix.
- shortest_
segment3d_ between_ lines3d - Finds the shortest segment connecting two 3D lines.
- transform_
vec3 - Transforms a 3D vector by a 4x4 matrix with perspective division.
- translate
- Creates a 4x4 translation matrix.
- tri_
normal - Computes the normal vector of a triangle.
- unproject3
- Unprojects screen coordinates back to 3D world space.
- vec2
- Convenience constructor for
Vec2i. - widget_
id_ of - Returns the pointer identity for a widget state object.
Use this when calling APIs such as
Container::set_focus.
Type Aliases§
- Basisd
- Double-precision basis.
- Basisf
- Single-precision basis.
- Box3d
- 3D double-precision axis-aligned bounding box.
- Box3f
- 3D single-precision axis-aligned bounding box.
- Color4b
- 4-component byte color (RGBA).
- Dimensionf
- Single-precision dimensions.
- Dimensioni
- Integer dimensions.
- Line2d
- 2D double-precision line.
- Line2f
- 2D single-precision line.
- Line3d
- 3D double-precision line.
- Line3f
- 3D single-precision line.
- Mat2d
- 2x2 double-precision matrix.
- Mat2f
- 2x2 single-precision matrix.
- Mat3d
- 3x3 double-precision matrix.
- Mat3f
- 3x3 single-precision matrix.
- Mat4d
- 4x4 double-precision matrix.
- Mat4f
- 4x4 single-precision matrix.
- Parametric
Planed - Double-precision parametric plane.
- Parametric
Planef - Single-precision parametric plane.
- Planed
- Double-precision plane.
- Planef
- Single-precision plane.
- Quatd
- Double-precision quaternion.
- Quatf
- Single-precision quaternion.
- Ray3d
- 3D double-precision ray.
- Ray3f
- 3D single-precision ray.
- Real
- Floating-point type used by widgets and layout calculations.
- Rectd
- Double-precision rectangle.
- Rectf
- Single-precision rectangle.
- Recti
- Integer rectangle.
- Segment2d
- 2D double-precision line segment.
- Segment2f
- 2D single-precision line segment.
- Segment3d
- 3D double-precision line segment.
- Segment3f
- 3D single-precision line segment.
- Vec2d
- 2D double-precision float vector.
- Vec2f
- 2D single-precision float vector.
- Vec2i
- 2D integer vector.
- Vec3d
- 3D double-precision float vector.
- Vec3f
- 3D single-precision float vector.
- Vec3i
- 3D integer vector.
- Vec4d
- 4D double-precision float vector.
- Vec4f
- 4D single-precision float vector.
- Vec4i
- 4D integer vector.
- Widget
Id - Raw trait-object pointer identity used for widget hover/focus tracking.