Expand description
Layout primitives for iced-plus.
This crate provides type-safe layout components with direction-aware alignment constraints and compile-time guarantees.
§Key Types
HStack- Horizontal stack layout (left to right)VStack- Vertical stack layout (top to bottom)AppShell- Application shell with sidebar and header areasModal- Modal overlay with backdropBreakpoints- Responsive breakpoint definitionsShowOn- Show content only at certain breakpoints
§Type Safety
The direction is encoded in the type system:
HStackonly acceptsVerticalcross-axis alignmentVStackonly acceptsHorizontalcross-axis alignment
This prevents mistakes like trying to set horizontal alignment on an HStack.
§Responsive Layouts
Use breakpoint helpers to create adaptive UIs:
ⓘ
use iced_plus_layouts::{ShowOn, BreakpointTier};
// Only show on medium screens and up
ShowOn::new(sidebar).min(BreakpointTier::MD)§Example
ⓘ
use iced_plus_layouts::{HStack, VStack};
use iced::alignment;
let layout = VStack::new()
.spacing(16.0)
.align(alignment::Horizontal::Center) // Type-safe!
.push(text("Hello"))
.push(text("World"));Structs§
- AppShell
- Application shell with sidebar and main content areas.
- Breakpoints
- Standard breakpoint values in pixels.
- Horizontal
- Horizontal direction (left to right).
- Modal
- Modal builder for more control over the overlay.
- Responsive
- Responsive value that changes based on breakpoint.
- Responsive
Row - A responsive row that stacks vertically on small screens.
- ShowOn
- A wrapper that shows content only at certain breakpoints.
- Stack
- A stack layout that arranges children in a single direction.
- Vertical
- Vertical direction (top to bottom).
Enums§
- Breakpoint
Tier - Breakpoint tier enum for pattern matching.
Traits§
- Direction
- Trait for layout directions with associated cross-axis alignment.
Functions§
- drawer
- Creates a drawer overlay that slides in from the side.
- drawer_
left - Creates a drawer overlay from the left with custom width.
- drawer_
right - Creates a drawer overlay from the right with custom width.
- hide_on
- Convenience function to hide content on certain breakpoints.
- modal
- Creates a modal overlay that displays content over a backdrop.
- modal_
with_ opacity - Creates a modal overlay with custom backdrop opacity.
- responsive_
row - Convenience function to create a responsive row.
- show_on
- Convenience function to create a ShowOn wrapper.