Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DevToys-app/DevToys/llms.txt

Use this file to discover all available pages before exploring further.

Layout components are the structural building blocks of a DevToys tool UI. They do not display content themselves but organise child IUIElement instances in space. All layout components are created through static factory methods on the GUI class (namespace DevToys.Api) and support a fluent builder pattern — each method returns the same instance, allowing chaining.

IUIStack

A component that stacks child elements in a single line, either horizontally or vertically. This is the most common layout primitive. Factory:
public static IUIStack Stack()
public static IUIStack Stack(string? id)

Properties

PropertyTypeDefaultDescription
OrientationUIOrientationHorizontalDirection in which children are arranged.
SpacingUISpacingSmallSpace between child elements.
UseMaxHeightboolfalseWhen true, the stack stretches to fill all available vertical space.
ChildrenIUIElement[]?nullThe child elements.

Events

OrientationChanged, SpacingChanged, ChildrenChanged, HeightChanged

Fluent Methods

// Orientation
IUIStack Horizontal(this IUIStack element)
IUIStack Vertical(this IUIStack element)

// Spacing
IUIStack NoSpacing(this IUIStack element)
IUIStack SmallSpacing(this IUIStack element)
IUIStack MediumSpacing(this IUIStack element)
IUIStack LargeSpacing(this IUIStack element)

// Height
IUIStack UseMaxHeight(this IUIStack element)

// Children
IUIStack WithChildren(this IUIStack element, params IUIElement[] children)

Example

GUI.Stack("toolbar")
   .Horizontal()
   .SmallSpacing()
   .WithChildren(
       GUI.Button(null, "Encode").AccentAppearance(),
       GUI.Button(null, "Decode"),
       GUI.Switch("mode-switch"));

IUIGrid

A flexible grid that arranges children into explicitly defined rows and columns. Each child is placed in a cell created with GUI.Cell(...). Factory:
public static IUIGrid Grid()
public static IUIGrid Grid(string? id)

Properties

PropertyTypeDefaultDescription
RowsUIGridLength[]?nullRow height definitions.
ColumnsUIGridLength[]?nullColumn width definitions.
CellsIUIGridCell[]?nullCell placements.
RowSpacingUISpacingSmallVertical gap between rows.
ColumnSpacingUISpacingSmallHorizontal gap between columns.

UIGridLength

UIGridLength describes a row height or column width. Three sizing modes are available:
// Auto-size to content
UIGridLength.Auto                             // => Auto

// Absolute pixel size
new UIGridLength(200)                         // => 200px
new UIGridLength(200, UIGridUnitType.Pixel)   // => 200px

// Fractional (proportional) size
new UIGridLength(1, UIGridUnitType.Fraction)  // => 1*
new UIGridLength(2, UIGridUnitType.Fraction)  // => 2*

// Convenience via GUI static helpers
GUI.Auto       // => UIGridLength.Auto
GUI.Fraction(1) // => new UIGridLength(1, UIGridUnitType.Fraction)
A double can be implicitly cast to a pixel UIGridLength: (UIGridLength)300.0 equals new UIGridLength(300, UIGridUnitType.Pixel).

UIGridCell

Cells are created with GUI.Cell(...) and placed into the grid via .Cells(...):
// Explicit spans (row, column, rowSpan, columnSpan, optional child)
IUIGridCell Cell(int row, int column, int rowSpan, int columnSpan, IUIElement? child = null)

// Enum-based single cell (safer, compile-time-checked)
IUIGridCell Cell<TRow, TColumn>(TRow row, TColumn column, IUIElement? child = null)

// Enum-based with spans (first and last row/column, optional child)
IUIGridCell Cell<TRow, TColumn>(TRow firstRow, TRow lastRow, TColumn firstColumn, TColumn? lastColumn = default, IUIElement? child = null)
Cell fluent setters: .Row(int), .Column(int), .RowSpan(int), .ColumnSpan(int), .WithChild(IUIElement?)

Fluent Methods

// Row definitions
IUIGrid Rows(this IUIGrid element, params UIGridLength[] heights)
IUIGrid Rows<TEnum>(this IUIGrid element, params (TEnum name, UIGridLength height)[] rows)

// Column definitions
IUIGrid Columns(this IUIGrid element, params UIGridLength[] widths)
IUIGrid Columns<TEnum>(this IUIGrid element, params (TEnum name, UIGridLength width)[] columns)

// Cell placements
IUIGrid Cells(this IUIGrid element, params IUIGridCell[] cells)

// Row spacing
IUIGrid RowNoSpacing(this IUIGrid element)
IUIGrid RowSmallSpacing(this IUIGrid element)
IUIGrid RowMediumSpacing(this IUIGrid element)
IUIGrid RowLargeSpacing(this IUIGrid element)

// Column spacing
IUIGrid ColumnNoSpacing(this IUIGrid element)
IUIGrid ColumnSmallSpacing(this IUIGrid element)
IUIGrid ColumnMediumSpacing(this IUIGrid element)
IUIGrid ColumnLargeSpacing(this IUIGrid element)

Example with Enum-based Rows/Columns

private enum Rows    { Top, Bottom }
private enum Columns { Left, Right }

GUI.Grid("main-grid")
   .RowMediumSpacing()
   .ColumnMediumSpacing()
   .Rows(
       (Rows.Top,    GUI.Auto),
       (Rows.Bottom, GUI.Fraction(1)))
   .Columns(
       (Columns.Left,  GUI.Fraction(1)),
       (Columns.Right, GUI.Fraction(1)))
   .Cells(
       GUI.Cell(Rows.Top, Rows.Top, Columns.Left, Columns.Right,
           child: GUI.Label(null, "Header").Style(UILabelStyle.Subtitle)),
       GUI.Cell(Rows.Bottom, Columns.Left,
           child: GUI.MultiLineTextInput("left-input")),
       GUI.Cell(Rows.Bottom, Columns.Right,
           child: GUI.MultiLineTextInput("right-output").ReadOnly()));

IUISplitGrid

A two-pane layout that divides an area into left/right or top/bottom cells separated by a draggable gutter. This is ideal for side-by-side editor/output panels. Factory:
public static IUISplitGrid SplitGrid()
public static IUISplitGrid SplitGrid(string? id)

Properties

PropertyTypeDefaultDescription
OrientationUIOrientationVerticalVertical splits left/right; Horizontal splits top/bottom.
MinimumCellLengthint50Minimum pane size in pixels.
LeftOrTopCellLengthUIGridLength1*Size of the left or top pane. Auto is not supported.
RightOrBottomCellLengthUIGridLength1*Size of the right or bottom pane. Auto is not supported.
LeftOrTopCellContentIUIElement?nullElement in the left/top pane.
RightOrBottomCellContentIUIElement?nullElement in the right/bottom pane.

Fluent Methods

// Orientation
IUISplitGrid Vertical(this IUISplitGrid element)
IUISplitGrid Horizontal(this IUISplitGrid element)

// Pane sizes
IUISplitGrid LeftPaneLength(this IUISplitGrid element, UIGridLength length)
IUISplitGrid RightPaneLength(this IUISplitGrid element, UIGridLength length)
IUISplitGrid TopPaneLength(this IUISplitGrid element, UIGridLength length)
IUISplitGrid BottomPaneLength(this IUISplitGrid element, UIGridLength length)

// Pane content
IUISplitGrid WithLeftPaneChild(this IUISplitGrid element, IUIElement? child)
IUISplitGrid WithRightPaneChild(this IUISplitGrid element, IUIElement? child)
IUISplitGrid WithTopPaneChild(this IUISplitGrid element, IUIElement? child)
IUISplitGrid WithBottomPaneChild(this IUISplitGrid element, IUIElement? child)

// Minimum pane size
IUISplitGrid MinimumLength(this IUISplitGrid element, int minimumLength)

Example

GUI.SplitGrid("editor-split")
   .Vertical()
   .LeftPaneLength(GUI.Fraction(1))
   .RightPaneLength(GUI.Fraction(1))
   .WithLeftPaneChild(
       GUI.MultiLineTextInput("input").Language("json"))
   .WithRightPaneChild(
       GUI.MultiLineTextInput("output").ReadOnly());
UIGridLength.Auto is not supported as a pane length in IUISplitGrid. Use Fraction or pixel values only.

IUIWrap

A wrap panel that lays out children horizontally and automatically flows them into additional rows when space runs out. Useful for tag displays or button toolbars that should reflow at narrow widths. Factory:
public static IUIWrap Wrap()
public static IUIWrap Wrap(string? id)

Properties

PropertyTypeDefaultDescription
SpacingUISpacingSmallSpace between each child element.
ChildrenIUIElement[]?nullThe child elements to wrap.

Fluent Methods

IUIWrap WithChildren(this IUIWrap element, params IUIElement[] children)
IUIWrap NoSpacing(this IUIWrap element)
IUIWrap SmallSpacing(this IUIWrap element)
IUIWrap MediumSpacing(this IUIWrap element)
IUIWrap LargeSpacing(this IUIWrap element)

Example

GUI.Wrap("tag-list")
   .SmallSpacing()
   .WithChildren(
       GUI.Button(null, "JSON"),
       GUI.Button(null, "YAML"),
       GUI.Button(null, "TOML"),
       GUI.Button(null, "XML"));

IUICard

A decorative wrapper that applies card-style styling (border, background, padding) to a single child element. Use it to visually separate a section of the tool UI. Factory:
public static IUICard Card(IUIElement uiElement)
public static IUICard Card(string? id, IUIElement uiElement)
The wrapped element is provided at construction time and cannot be changed after creation.

Properties

PropertyTypeDescription
UIElementIUIElementThe single child element displayed inside the card.

Example

GUI.Card(
    GUI.Stack()
       .Vertical()
       .MediumSpacing()
       .WithChildren(
           GUI.Label(null, "Options").Style(UILabelStyle.Subtitle),
           GUI.Switch("indent-switch").Title("Indent output")));

Supporting Enums

UISpacing

public enum UISpacing
{
    None   = 0,  // No space — for tightly coupled elements
    Small  = 1,  // Small gap — for elements in the same group
    Medium = 2,  // Medium gap — between groups of elements
    Large  = 3   // Large gap — between distinct sections
}

UIOrientation

[Flags]
public enum UIOrientation
{
    Horizontal = 1,
    Vertical   = 2
}

UIGridUnitType

public enum UIGridUnitType
{
    Auto     = 0,  // Size to content
    Pixel    = 1,  // Fixed device-independent pixels
    Fraction = 2   // Proportional share of remaining space
}

Build docs developers (and LLMs) love