Expand description
Pane grids let your users split regions of your application and organize layout dynamically.

This distribution of space is common in tiling window managers (like
awesome, i3, or even
tmux).
A PaneGrid supports:
- Vertical and horizontal splits
- Tracking of the last active pane
- Mouse-based resizing
- Drag and drop to reorganize panes
- Hotkey support
- Configurable modifier keys
StateAPI to perform actions programmatically (split,swap,resize, etc.)
§Example
use iced::widget::{pane_grid, text};
struct State {
panes: pane_grid::State<Pane>,
}
enum Pane {
SomePane,
AnotherKindOfPane,
}
enum Message {
PaneDragged(pane_grid::DragEvent),
PaneResized(pane_grid::ResizeEvent),
}
fn view(state: &State) -> Element<'_, Message> {
pane_grid(&state.panes, |pane, state, is_maximized| {
pane_grid::Content::new(match state {
Pane::SomePane => text("This is some pane"),
Pane::AnotherKindOfPane => text("This is another kind of pane"),
})
})
.on_drag(Message::PaneDragged)
.on_resize(10, Message::PaneResized)
.into()
}The pane_grid example showcases how to use a PaneGrid with resizing,
drag and drop, and hotkey support.
Modules§
Structs§
- Content
- The content of a
Pane. - Controls
- The controls of a
Pane. - Highlight
- The appearance of a highlight of the
PaneGrid. - Line
- A line.
- Pane
- A rectangular region in a
PaneGridused to display widgets. - Pane
Grid - A collection of panes distributed using either vertical or horizontal splits to completely fill the space available.
- Resize
Event - An event produced during a resize interaction of a
PaneGrid. - Split
- A divider that splits a region in a
PaneGridinto two different panes. - State
- The state of a
PaneGrid. - Style
- The appearance of a
PaneGrid. - Title
Bar - The title bar of a
Pane.
Enums§
- Axis
- A fixed reference line for the measurement of coordinates.
- Configuration
- The arrangement of a
PaneGrid. - Direction
- A four cardinal direction.
- Drag
Event - An event produced during a drag and drop interaction of a
PaneGrid. - Edge
- The edges of an area.
- Node
- A layout node of a
PaneGrid. - Region
- The region of a
Pane. - Target
- The
Targetarea a pane can be dropped on.