gum-layout

Featured

Reference guide for Gum's layout system — dimension units, position units, children layout modes, layout calculation flow, and layout suspension. Load when working on Width/HeightUnits, XUnits/YUnits, stacking, wrapping, auto-sizing, Anchor/Dock, or GraphicalUiElement layout logic. For deep engine internals (debugging/optimizing UpdateLayout, UpdateChildren, dirty state), see the gum-layout-engine skill instead.

Web & Frontend 661 stars 88 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
94
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Gum Layout System Gum's layout is driven by **unit enums** that tell the engine how to interpret numeric Width/Height/X/Y values, plus a **children layout** mode on containers. All layout lives in `GraphicalUiElement` (`GumRuntime/GraphicalUiElement.cs`). ## Key Concepts ### Dimension Units (Width & Height) `DimensionUnitType` enum (`GumDataTypes/DimensionUnitType.cs`) controls how a Width or Height value is interpreted. Units fall into dependency categories: | Dependency | Units | |---|---| | No dependency | Absolute, PercentageOfSourceFile, PercentageOfOtherDimension, MaintainFileAspectRatio, AbsoluteMultipliedByFontScale, ScreenPixel | | Depends on parent | PercentageOfParent, RelativeToParent, RelativeToMaxParentOrChildren* | | Depends on children | RelativeToChildren | | Depends on siblings | Ratio | \* `RelativeToMaxParentOrChildren` is classified as `DependsOnParent` but also depends on children — special-cased throughout the layout engine. See [dimension-units.md](dimension-units.md) for circular dependency handling. See [dimension-units.md](dimension-units.md) for detailed descriptions. ### Position Units (X & Y) `GeneralUnitType` enum (`GumDataTypes/UnitConverter.cs`) controls how X/Y values are measured: from edges, center, baseline, or as percentages. Combined with **XOrigin/YOrigin** (HorizontalAlignment/VerticalAlignment) to set which point on the element is being positioned. See [dimension-units.md](dimension-units.md) for detailed descriptions. ### ...

Details

Author
vchelaru
Repository
vchelaru/Gum
Created
11 years ago
Last Updated
today
Language
C#
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Web & Frontend Listed

better-layout

Layout structure for web interfaces, from grouping and alignment to reading order, progressive disclosure, and adaptive breakpoints. Use when structuring a page or component, spacing or aligning controls, deciding what collapses at small sizes, handling RTL layout direction, or reviewing frontend code for layout. Triggers on layout, spacing, alignment, grouping, negative space, whitespace, visual hierarchy, reading order, progressive disclosure, breakpoints, responsive layout, container queries, safe area, full-bleed, edge-to-edge, layout margins, RTL layout, logical properties.

1 Updated 2 months ago
SkotAlexsander
Web & Frontend Listed

using-mewui-layout

Arranges UI elements using MewUI layout panels. Use when building UI layouts with StackPanel, Grid, Canvas, DockPanel, WrapPanel, or creating custom panels.

41 Updated 4 months ago
christian289
Web & Frontend Listed

adaptive-layout

Enforces adapting layout by available CONSTRAINTS/size, never device or platform checks — LayoutBuilder + MediaQuery.sizeOf/paddingOf/viewInsetsOf (not .of) for narrow rebuilds, Material 3 window size classes (compact <600, medium 600-840, expanded 840-1200, large >1200) as the breakpoint vocabulary, navigation affordance chosen by width (NavigationBar → NavigationRail → NavigationDrawer), list-detail single-pane-vs-two-pane, readable max-width via ConstrainedBox, Flexible/Expanded/FractionallySizedBox over fixed widths, SafeArea + display cutouts + keyboard insets, never lock orientation, foldable/hinge awareness via MediaQuery.displayFeatures, and golden-matrix verification across sizes. Use when building responsive or adaptive UI, tablet/desktop/foldable support, master-detail or two-pane screens, a NavigationRail-vs-BottomNav shell, breakpoints, LayoutBuilder, MediaQuery sizing, SafeArea/cutouts, or fixing overflow at large widths.

0 Updated 3 months ago
zakariaf