Skip to main content

Module grid_layout

Module grid_layout 

Source
Expand description

What this design system paints on a grid layout.

Base owns the grid: where items sit, the drag, the resize, the keyboard and the layout arithmetic. Everything here is appearance — the gap, the motion items settle with, the drop placeholder, the resize grip, and how the dragged and the keyboard-selected items stand out.

Structs§

GridArea
Where one item sits in a grid layout, in zero-based grid cells.
GridItem
One item of a GridLayout, paired with the GridArea of the same id.
GridLayout
A grid whose items the user drags and resizes, the way dashboards and widget boards are arranged.
GridLayoutState
The state of a GridLayout: the items’ areas, the rules the layout settles under, and any gesture in progress.
GrowHeight
Make the selected item one row taller.
GrowWidth
Make the selected item one column wider.
MoveDown
Move the selected item down one row.
MoveLeft
Move the selected item one column toward the leading edge.
MoveRight
Move the selected item one column toward the trailing edge.
MoveUp
Move the selected item up one row.
SelectNextItem
Select the next item in reading order.
SelectPreviousItem
Select the previous item in reading order.
ShrinkHeight
Make the selected item one row shorter.
ShrinkWidth
Make the selected item one column narrower.

Enums§

GridLayoutEvent
Emitted by GridLayoutState when the layout changes.

Functions§

grid_drag_handle
The part of an item the pointer moves it by, for an item built with GridItem::drag_handle_only — a card’s header, say.
grid_layout
Create a GridLayout wearing this design system: the theme’s medium spacing between items, its move motion, a dashed drop placeholder, a resize grip in each resizable item’s corner and a raised dragged item.