Xui.Core.UI.Layout

Assembly: Xui.Core · C# declarations · Assembly overview

Types

class FlexBox

A container view that arranges children along a main axis with flexible sizing and wrapping. Container-level properties mirror the CSS Flex Box spec.

Supports row/column layout, wrapping, order, gaps, flexible sizing, and space distribution. Item baseline alignment currently falls back to cross-axis start; line baseline alignment falls back to start. Views do not yet expose a common layout-baseline contract.

public partial class FlexBox
{
    public enum AlignContent : byte
    {
        Normal = 0,
        FlexStart = 1,
        FlexEnd = 2,
        Center = 3,
        SpaceBetween = 4,
        SpaceAround = 5,
        SpaceEvenly = 6,
        Stretch = 7,
        FirstBaseline = 8,
        LastBaseline = 9,
    }
}
public partial class FlexBox
{
    public enum AlignItems : byte
    {
        Normal = 0,
        Stretch = 1,
        FlexStart = 2,
        FlexEnd = 3,
        Center = 4,
        Baseline = 5,
        FirstBaseline = 6,
        LastBaseline = 7,
    }
}
public partial class FlexBox
{
    public new enum Direction : byte
    {
        Row = 0,
        RowReverse = 1,
        Column = 2,
        ColumnReverse = 3,
    }
}
public partial class FlexBox
{
    public static readonly View.Extra<nint> Order;
    public static readonly View.Extra<nfloat> Grow;
    public static readonly View.Extra<nfloat> Shrink;
    public static readonly View.Extra<nfloat> Basis;
}
public partial class FlexBox
{
    public enum JustifyContent : byte
    {
        Normal = 0,
        FlexStart = 1,
        FlexEnd = 2,
        Center = 3,
        SpaceBetween = 4,
        SpaceAround = 5,
        SpaceEvenly = 6,
        Start = 7,
        End = 8,
    }
}
public partial class FlexBox
{
    protected override Size MeasureCore(Size available, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
}
public partial class FlexBox
{
    public enum Wrap : byte
    {
        NoWrap = 0,
        Wrap = 1,
        WrapReverse = 2,
    }
}
public partial class FlexBox : ViewCollection
{
    public Direction FlexDirection { get; set; }
    public Wrap FlexWrap { get; set; }
    public JustifyContent FlexJustifyContent { get; set; }
    public AlignItems FlexAlignItems { get; set; }
    public AlignContent FlexAlignContent { get; set; }
    public nfloat RowGap { get; set; }
    public nfloat ColumnGap { get; set; }
}

void FlexBox.ArrangeCore(Rect rect, IMeasureContext context)

protected override void ArrangeCore(Rect rect, IMeasureContext context);

Override to arrange children within this view's final frame.

Extra<NFloat> FlexBox.Basis

public static readonly View.Extra<nfloat> Basis;

The initial size of the item along the main axis before free space is distributed. nfloat.NaN means auto (use the item's width or height). Corresponds to CSS flex-basis.

NFloat FlexBox.ColumnGap

public nfloat ColumnGap { get; set; }

Space between columns of flex items. Corresponds to column-gap. Default is 0.

AlignContent FlexBox.FlexAlignContent

public AlignContent FlexAlignContent { get; set; }

Aligns flex lines along the cross axis when there is extra space (only applies when wrapping). Corresponds to align-content. Default is Xui.Core.UI.Layout.FlexBox.AlignContent.Normal.

AlignItems FlexBox.FlexAlignItems

public AlignItems FlexAlignItems { get; set; }

Sets the default cross-axis alignment for all flex items on a line. Corresponds to align-items. Default is Xui.Core.UI.Layout.FlexBox.AlignItems.Stretch.

Direction FlexBox.FlexDirection

public Direction FlexDirection { get; set; }

Sets the main axis direction along which flex items are placed. Corresponds to flex-direction. Default is Xui.Core.UI.Layout.FlexBox.Direction.Row.

JustifyContent FlexBox.FlexJustifyContent

public JustifyContent FlexJustifyContent { get; set; }

Aligns flex items along the main axis when there is free space. Corresponds to justify-content. Default is Xui.Core.UI.Layout.FlexBox.JustifyContent.FlexStart.

Wrap FlexBox.FlexWrap

public Wrap FlexWrap { get; set; }

Controls whether flex items wrap onto multiple lines. Corresponds to flex-wrap. Default is Xui.Core.UI.Layout.FlexBox.Wrap.NoWrap.

Extra<NFloat> FlexBox.Grow

public static readonly View.Extra<nfloat> Grow;

How much the item will grow relative to other flex items when free space is available. Corresponds to CSS flex-grow. Default is 0 (does not grow).

Size FlexBox.MeasureCore(Size available, IMeasureContext context)

protected override Size MeasureCore(Size available, IMeasureContext context);

Override to compute the desired border-edge size.

Extra<nint> FlexBox.Order

public static readonly View.Extra<nint> Order;

Controls the order in which the item appears within the flex container, overriding source order. Corresponds to CSS order.

NFloat FlexBox.RowGap

public nfloat RowGap { get; set; }

Space between rows of flex items. Corresponds to row-gap. Default is 0.

Extra<NFloat> FlexBox.Shrink

public static readonly View.Extra<nfloat> Shrink;

How much the item will shrink relative to other flex items when space is insufficient. Corresponds to CSS flex-shrink. Default is 1 (shrinks evenly).

enum FlexBox.AlignContent

Aligns flex lines along the cross axis when there is extra space (only applies when wrapping). Corresponds to the CSS align-content property on a flex container.

public enum AlignContent : byte
{
    Normal = 0,
    FlexStart = 1,
    FlexEnd = 2,
    Center = 3,
    SpaceBetween = 4,
    SpaceAround = 5,
    SpaceEvenly = 6,
    Stretch = 7,
    FirstBaseline = 8,
    LastBaseline = 9,
}

AlignContent.Center

Center = 3

Lines are centered on the cross axis.

AlignContent.FirstBaseline

FirstBaseline = 8

Lines are aligned along their first baseline.

AlignContent.FlexEnd

FlexEnd = 2

Lines are packed toward the flex-end edge of the cross axis.

AlignContent.FlexStart

FlexStart = 1

Lines are packed toward the flex-start edge of the cross axis.

AlignContent.LastBaseline

LastBaseline = 9

Lines are aligned along their last baseline.

AlignContent.Normal

Normal = 0

Browser default. Acts like Xui.Core.UI.Layout.FlexBox.AlignContent.Stretch.

AlignContent.SpaceAround

SpaceAround = 5

Lines are evenly distributed with equal space around each line.

AlignContent.SpaceBetween

SpaceBetween = 4

Lines are evenly distributed; first line at start, last at end.

AlignContent.SpaceEvenly

SpaceEvenly = 6

Lines are evenly distributed with equal space between all lines including edges.

AlignContent.Stretch

Stretch = 7

Lines are stretched to fill the container.

enum FlexBox.AlignItems

Sets the default cross-axis alignment for all flex items on a line. Corresponds to the CSS align-items property on a flex container.

public enum AlignItems : byte
{
    Normal = 0,
    Stretch = 1,
    FlexStart = 2,
    FlexEnd = 3,
    Center = 4,
    Baseline = 5,
    FirstBaseline = 6,
    LastBaseline = 7,
}

AlignItems.Baseline

Baseline = 5

Items are aligned along their first baseline.

AlignItems.Center

Center = 4

Items are centered on the cross axis.

AlignItems.FirstBaseline

FirstBaseline = 6

Items are aligned along their first baseline (same as Xui.Core.UI.Layout.FlexBox.AlignItems.Baseline).

AlignItems.FlexEnd

FlexEnd = 3

Items are packed toward the flex-end edge of the cross axis.

AlignItems.FlexStart

FlexStart = 2

Items are packed toward the flex-start edge of the cross axis.

AlignItems.LastBaseline

LastBaseline = 7

Items are aligned along their last baseline.

AlignItems.Normal

Normal = 0

Browser default. Acts like Xui.Core.UI.Layout.FlexBox.AlignItems.Stretch.

AlignItems.Stretch

Stretch = 1

Items are stretched to fill the cross axis.

enum FlexBox.Direction

Specifies the direction of the main axis along which flex items are placed. Corresponds to the CSS flex-direction property.

public new enum Direction : byte
{
    Row = 0,
    RowReverse = 1,
    Column = 2,
    ColumnReverse = 3,
}

Direction.Column

Column = 2

Items are placed top to bottom (block-start to block-end).

Direction.ColumnReverse

ColumnReverse = 3

Items are placed bottom to top (block-end to block-start).

Direction.Row

Row = 0

Items are placed left to right (inline-start to inline-end).

Direction.RowReverse

RowReverse = 1

Items are placed right to left (inline-end to inline-start).

enum FlexBox.JustifyContent

Aligns flex items along the main axis when there is free space. Corresponds to the CSS justify-content property on a flex container.

public enum JustifyContent : byte
{
    Normal = 0,
    FlexStart = 1,
    FlexEnd = 2,
    Center = 3,
    SpaceBetween = 4,
    SpaceAround = 5,
    SpaceEvenly = 6,
    Start = 7,
    End = 8,
}

JustifyContent.Center

Center = 3

Items are centered along the main axis.

JustifyContent.End

End = 8

Items are packed toward the end of the main axis.

JustifyContent.FlexEnd

FlexEnd = 2

Items are packed toward the flex-end edge of the main axis.

JustifyContent.FlexStart

FlexStart = 1

Items are packed toward the flex-start edge of the main axis.

JustifyContent.Normal

Normal = 0

Browser default. Acts like Xui.Core.UI.Layout.FlexBox.JustifyContent.FlexStart.

JustifyContent.SpaceAround

SpaceAround = 5

Items are evenly distributed with equal space around each item.

JustifyContent.SpaceBetween

SpaceBetween = 4

Items are evenly distributed; first item at start, last at end.

JustifyContent.SpaceEvenly

SpaceEvenly = 6

Items are evenly distributed with equal space between all items including edges.

JustifyContent.Start

Start = 7

Items are packed toward the start of the main axis.

enum FlexBox.Wrap

Controls whether flex items are forced onto a single line or can wrap onto multiple lines. Corresponds to the CSS flex-wrap property.

public enum Wrap : byte
{
    NoWrap = 0,
    Wrap = 1,
    WrapReverse = 2,
}

Wrap.NoWrap

NoWrap = 0

All flex items are on a single line.

Wrap.Wrap

Wrap = 1

Flex items wrap onto additional lines in the block-start direction.

Wrap.WrapReverse

WrapReverse = 2

Flex items wrap onto additional lines in the block-end direction.

class Grid

A container view that arranges children in a grid of rows and columns. Container-level properties mirror the CSS Grid spec.

CSS Grid Layout implementation for the Grid container. Provides MeasureCore and ArrangeCore implementations following the CSS Grid Layout Module Level 1 specification.

Implementation notes:

  • Track sizing supports: Length, Auto, MinContent, MaxContent, Fr (fractional units), MinMax, and FitContent
  • Auto-placement follows grid-auto-flow (row or column direction)
  • Named grid areas are parsed from TemplateAreas
  • Gaps are applied between tracks
  • Alignment is supported via justify-items, align-items, justify-content, align-content
  • Child positioning via grid-row-start/end, grid-column-start/end, and grid-area

Algorithm approach:

  • Build grid structure: parse areas, determine placement for each child
  • Measure tracks: resolve fixed sizes, content-based sizes, then distribute fr units
  • Arrange children: position each child in its grid area with alignment
public partial class Grid
{
    public enum AlignContent : byte
    {
        Normal = 0,
        Start = 1,
        End = 2,
        Center = 3,
        SpaceBetween = 4,
        SpaceAround = 5,
        SpaceEvenly = 6,
        Stretch = 7,
        FirstBaseline = 8,
        LastBaseline = 9,
    }
}
public partial class Grid
{
    public enum AlignItems : byte
    {
        Normal = 0,
        Stretch = 1,
        Start = 2,
        End = 3,
        Center = 4,
        Baseline = 5,
        FirstBaseline = 6,
        LastBaseline = 7,
    }
}
public partial class Grid
{
    public enum AutoFlow : byte
    {
        Row = 0,
        Column = 1,
        RowDense = 2,
        ColumnDense = 3,
    }
}
public partial class Grid
{
    public static readonly View.Extra<nint> RowStart;
    public static readonly View.Extra<nint> RowEnd;
    public static readonly View.Extra<nint> ColumnStart;
    public static readonly View.Extra<nint> ColumnEnd;
    public static readonly View.Extra<string?> Area;
    public static readonly View.Extra<nint> Order;
    public static readonly View.Extra<nint> RowSpan;
    public static readonly View.Extra<nint> ColumnSpan;
}
public partial class Grid
{
    public enum JustifyContent : byte
    {
        Normal = 0,
        Start = 1,
        End = 2,
        Center = 3,
        Left = 4,
        Right = 5,
        SpaceBetween = 6,
        SpaceAround = 7,
        SpaceEvenly = 8,
        Stretch = 9,
    }
}
public partial class Grid
{
    public enum JustifyItems : byte
    {
        Normal = 0,
        Stretch = 1,
        Start = 2,
        End = 3,
        Center = 4,
        Left = 5,
        Right = 6,
        Baseline = 7,
        FirstBaseline = 8,
        LastBaseline = 9,
    }
}
public partial class Grid
{
    protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
}
public partial class Grid
{
    public readonly struct TrackSize
    {
        public TrackSizeKind Kind { get; }
        public nfloat Value { get; }
        public nfloat MinValue { get; }
        public nfloat MaxValue { get; }

        public static readonly TrackSize Auto;
        public static readonly TrackSize MinContent;
        public static readonly TrackSize MaxContent;
        public static TrackSize Px(nfloat px);
        public static TrackSize Fr(nfloat fr);
        public static TrackSize MinMax(nfloat min, nfloat max);
        public static TrackSize FitContent(nfloat max);
        public static implicit operator TrackSize(nfloat px);
        public static implicit operator TrackSize(float px);
        public static implicit operator TrackSize(double px);
        public static implicit operator TrackSize(int px);
        public override string ToString();
    }

    public enum TrackSizeKind : byte
    {
        Auto = 0,
        MinContent = 1,
        MaxContent = 2,
        Length = 3,
        Fr = 4,
        MinMax = 5,
        FitContent = 6,
    }
}
public partial class Grid : ViewCollection
{
    public TrackSize[] TemplateColumns { get; set; }
    public TrackSize[] TemplateRows { get; set; }
    public string[] TemplateAreas { get; set; }
    public TrackSize AutoColumns { get; set; }
    public TrackSize AutoRows { get; set; }
    public AutoFlow GridAutoFlow { get; set; }
    public JustifyItems GridJustifyItems { get; set; }
    public AlignItems GridAlignItems { get; set; }
    public JustifyContent GridJustifyContent { get; set; }
    public AlignContent GridAlignContent { get; set; }
    public nfloat RowGap { get; set; }
    public nfloat ColumnGap { get; set; }
}

Extra<string?> Grid.Area

public static readonly View.Extra<string?> Area;

Places the item into a named grid area defined by Xui.Core.UI.Layout.Grid.TemplateAreas. Corresponds to CSS grid-area.

void Grid.ArrangeCore(Rect rect, IMeasureContext context)

protected override void ArrangeCore(Rect rect, IMeasureContext context);

Override to arrange children within this view's final frame.

TrackSize Grid.AutoColumns

public TrackSize AutoColumns { get; set; }

Sizing for implicitly created columns (those outside Xui.Core.UI.Layout.Grid.TemplateColumns). Corresponds to grid-auto-columns. Default is Xui.Core.UI.Layout.Grid.TrackSize.Auto.

TrackSize Grid.AutoRows

public TrackSize AutoRows { get; set; }

Sizing for implicitly created rows (those outside Xui.Core.UI.Layout.Grid.TemplateRows). Corresponds to grid-auto-rows. Default is Xui.Core.UI.Layout.Grid.TrackSize.Auto.

Extra<nint> Grid.ColumnEnd

public static readonly View.Extra<nint> ColumnEnd;

The grid line where the item's column ends (1-indexed, exclusive). 0 means auto. Corresponds to CSS grid-column-end.

NFloat Grid.ColumnGap

public nfloat ColumnGap { get; set; }

Space between grid columns. Corresponds to column-gap. Default is 0.

Extra<nint> Grid.ColumnSpan

public static readonly View.Extra<nint> ColumnSpan;

The number of columns the item spans. Shorthand for setting Xui.Core.UI.Layout.Grid.ColumnEnd = Xui.Core.UI.Layout.Grid.ColumnStart + ColumnSpan.

Extra<nint> Grid.ColumnStart

public static readonly View.Extra<nint> ColumnStart;

The grid line where the item's column starts (1-indexed). 0 means auto. Corresponds to CSS grid-column-start.

AlignContent Grid.GridAlignContent

public AlignContent GridAlignContent { get; set; }

Aligns the grid along the block axis within the container when the grid is smaller than the container. Corresponds to align-content. Default is Xui.Core.UI.Layout.Grid.AlignContent.Start.

AlignItems Grid.GridAlignItems

public AlignItems GridAlignItems { get; set; }

Sets the default block-axis alignment for all grid items within their grid areas. Corresponds to align-items. Default is Xui.Core.UI.Layout.Grid.AlignItems.Stretch.

AutoFlow Grid.GridAutoFlow

public AutoFlow GridAutoFlow { get; set; }

Controls how auto-placed items flow into the grid. Corresponds to grid-auto-flow. Default is Xui.Core.UI.Layout.Grid.AutoFlow.Row.

JustifyContent Grid.GridJustifyContent

public JustifyContent GridJustifyContent { get; set; }

Aligns the grid along the inline axis within the container when the grid is smaller than the container. Corresponds to justify-content. Default is Xui.Core.UI.Layout.Grid.JustifyContent.Start.

JustifyItems Grid.GridJustifyItems

public JustifyItems GridJustifyItems { get; set; }

Sets the default inline-axis alignment for all grid items within their grid areas. Corresponds to justify-items. Default is Xui.Core.UI.Layout.Grid.JustifyItems.Stretch.

Size Grid.MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)

protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);

Override to compute the desired border-edge size.

Extra<nint> Grid.Order

public static readonly View.Extra<nint> Order;

Controls the order in which the item appears within the grid, overriding source order. Corresponds to CSS order.

Extra<nint> Grid.RowEnd

public static readonly View.Extra<nint> RowEnd;

The grid line where the item's row ends (1-indexed, exclusive). 0 means auto. Corresponds to CSS grid-row-end.

NFloat Grid.RowGap

public nfloat RowGap { get; set; }

Space between grid rows. Corresponds to row-gap. Default is 0.

Extra<nint> Grid.RowSpan

public static readonly View.Extra<nint> RowSpan;

The number of rows the item spans. Shorthand for setting Xui.Core.UI.Layout.Grid.RowEnd = Xui.Core.UI.Layout.Grid.RowStart + RowSpan.

Extra<nint> Grid.RowStart

public static readonly View.Extra<nint> RowStart;

The grid line where the item's row starts (1-indexed). 0 means auto. Corresponds to CSS grid-row-start.

string[] Grid.TemplateAreas

public string[] TemplateAreas { get; set; }

Defines named grid areas. Each string in the array defines one row; space-separated cell names define columns within that row. A dot (.) denotes an unnamed cell. Corresponds to grid-template-areas. Default is an empty array.

TrackSize[] Grid.TemplateColumns

public TrackSize[] TemplateColumns { get; set; }

Defines the track sizes for explicitly defined columns. Corresponds to grid-template-columns. Default is an empty array (no explicit columns).

TrackSize[] Grid.TemplateRows

public TrackSize[] TemplateRows { get; set; }

Defines the track sizes for explicitly defined rows. Corresponds to grid-template-rows. Default is an empty array (no explicit rows).

enum Grid.AlignContent

Aligns the grid along the block axis within the container when the grid is smaller than the container. Corresponds to the CSS align-content property on a grid container.

public enum AlignContent : byte
{
    Normal = 0,
    Start = 1,
    End = 2,
    Center = 3,
    SpaceBetween = 4,
    SpaceAround = 5,
    SpaceEvenly = 6,
    Stretch = 7,
    FirstBaseline = 8,
    LastBaseline = 9,
}

AlignContent.Center

Center = 3

Rows are centered on the block axis.

AlignContent.End

End = 2

Rows are packed toward the end of the block axis.

AlignContent.FirstBaseline

FirstBaseline = 8

Rows are aligned along their first baseline.

AlignContent.LastBaseline

LastBaseline = 9

Rows are aligned along their last baseline.

AlignContent.Normal

Normal = 0

Browser default. Acts like Xui.Core.UI.Layout.Grid.AlignContent.Stretch.

AlignContent.SpaceAround

SpaceAround = 5

Rows are evenly distributed with equal space around each row.

AlignContent.SpaceBetween

SpaceBetween = 4

Rows are evenly distributed; first row at start, last at end.

AlignContent.SpaceEvenly

SpaceEvenly = 6

Rows are evenly distributed with equal space between all rows including edges.

AlignContent.Start

Start = 1

Rows are packed toward the start of the block axis.

AlignContent.Stretch

Stretch = 7

Rows are stretched to fill the container block size.

enum Grid.AlignItems

Sets the default block-axis alignment for all grid items within their grid areas. Corresponds to the CSS align-items property on a grid container.

public enum AlignItems : byte
{
    Normal = 0,
    Stretch = 1,
    Start = 2,
    End = 3,
    Center = 4,
    Baseline = 5,
    FirstBaseline = 6,
    LastBaseline = 7,
}

AlignItems.Baseline

Baseline = 5

Items are aligned along their first baseline.

AlignItems.Center

Center = 4

Items are centered on the block axis.

AlignItems.End

End = 3

Items are packed toward the end of the block axis.

AlignItems.FirstBaseline

FirstBaseline = 6

Items are aligned along their first baseline (same as Xui.Core.UI.Layout.Grid.AlignItems.Baseline).

AlignItems.LastBaseline

LastBaseline = 7

Items are aligned along their last baseline.

AlignItems.Normal

Normal = 0

Browser default. Acts like Xui.Core.UI.Layout.Grid.AlignItems.Stretch.

AlignItems.Start

Start = 2

Items are packed toward the start of the block axis.

AlignItems.Stretch

Stretch = 1

Items are stretched to fill the grid area block size.

enum Grid.AutoFlow

Controls how auto-placed items are inserted into the grid. Corresponds to the CSS grid-auto-flow property.

public enum AutoFlow : byte
{
    Row = 0,
    Column = 1,
    RowDense = 2,
    ColumnDense = 3,
}

AutoFlow.Column

Column = 1

Auto-placed items fill each column in turn, adding new columns as needed.

AutoFlow.ColumnDense

ColumnDense = 3

Auto-placed items fill each column, using a dense packing algorithm that attempts to fill in holes earlier in the grid.

AutoFlow.Row

Row = 0

Auto-placed items fill each row in turn, adding new rows as needed.

AutoFlow.RowDense

RowDense = 2

Auto-placed items fill each row, using a dense packing algorithm that attempts to fill in holes earlier in the grid.

enum Grid.JustifyContent

Aligns the grid along the inline axis within the container when the grid is smaller than the container. Corresponds to the CSS justify-content property on a grid container.

public enum JustifyContent : byte
{
    Normal = 0,
    Start = 1,
    End = 2,
    Center = 3,
    Left = 4,
    Right = 5,
    SpaceBetween = 6,
    SpaceAround = 7,
    SpaceEvenly = 8,
    Stretch = 9,
}

JustifyContent.Center

Center = 3

Grid is centered along the inline axis.

JustifyContent.End

End = 2

Grid is packed toward the end of the inline axis.

JustifyContent.Left

Left = 4

Grid is packed toward the left end of the inline axis.

JustifyContent.Normal

Normal = 0

Browser default. Acts like Xui.Core.UI.Layout.Grid.JustifyContent.Start.

JustifyContent.Right

Right = 5

Grid is packed toward the right end of the inline axis.

JustifyContent.SpaceAround

SpaceAround = 7

Columns are evenly distributed with equal space around each column.

JustifyContent.SpaceBetween

SpaceBetween = 6

Columns are evenly distributed; first column at start, last at end.

JustifyContent.SpaceEvenly

SpaceEvenly = 8

Columns are evenly distributed with equal space between all columns including edges.

JustifyContent.Start

Start = 1

Grid is packed toward the start of the inline axis.

JustifyContent.Stretch

Stretch = 9

Columns are stretched to fill the container inline size.

enum Grid.JustifyItems

Sets the default justify-self for all items, aligning them along the inline axis within their grid area. Corresponds to the CSS justify-items property.

public enum JustifyItems : byte
{
    Normal = 0,
    Stretch = 1,
    Start = 2,
    End = 3,
    Center = 4,
    Left = 5,
    Right = 6,
    Baseline = 7,
    FirstBaseline = 8,
    LastBaseline = 9,
}

JustifyItems.Baseline

Baseline = 7

Items are aligned along their first baseline.

JustifyItems.Center

Center = 4

Items are centered along the inline axis.

JustifyItems.End

End = 3

Items are packed toward the end of the inline axis.

JustifyItems.FirstBaseline

FirstBaseline = 8

Items are aligned along their first baseline (same as Xui.Core.UI.Layout.Grid.JustifyItems.Baseline).

JustifyItems.LastBaseline

LastBaseline = 9

Items are aligned along their last baseline.

JustifyItems.Left

Left = 5

Items are packed toward the left end of the inline axis.

JustifyItems.Normal

Normal = 0

Browser default. Acts like Xui.Core.UI.Layout.Grid.JustifyItems.Stretch.

JustifyItems.Right

Right = 6

Items are packed toward the right end of the inline axis.

JustifyItems.Start

Start = 2

Items are packed toward the start of the inline axis.

JustifyItems.Stretch

Stretch = 1

Items are stretched to fill the grid area inline size.

readonly struct Grid.TrackSize

Represents a single CSS grid track sizing value such as a length, fr unit, auto, min-content, max-content, minmax(), or fit-content().

public readonly struct TrackSize
{
    public TrackSizeKind Kind { get; }
    public nfloat Value { get; }
    public nfloat MinValue { get; }
    public nfloat MaxValue { get; }

    public static readonly TrackSize Auto;
    public static readonly TrackSize MinContent;
    public static readonly TrackSize MaxContent;
    public static TrackSize Px(nfloat px);
    public static TrackSize Fr(nfloat fr);
    public static TrackSize MinMax(nfloat min, nfloat max);
    public static TrackSize FitContent(nfloat max);
    public static implicit operator TrackSize(nfloat px);
    public static implicit operator TrackSize(float px);
    public static implicit operator TrackSize(double px);
    public static implicit operator TrackSize(int px);
    public override string ToString();
}

TrackSize TrackSize.Auto

public static readonly TrackSize Auto;

The track sizes to content automatically. Equivalent to CSS auto.

TrackSize TrackSize.FitContent(NFloat max)

public static TrackSize FitContent(nfloat max);

Creates a fit-content(max) track clamped to the given pixel maximum.

TrackSize TrackSize.Fr(NFloat fr)

public static TrackSize Fr(nfloat fr);

Creates a fractional track. Fr(1) = CSS 1fr.

TrackSizeKind TrackSize.Kind

public TrackSizeKind Kind { get; }

The kind of track sizing function.

TrackSize TrackSize.MaxContent

public static readonly TrackSize MaxContent;

The track is sized to the largest max-content contribution of its items. Equivalent to CSS max-content.

NFloat TrackSize.MaxValue

public nfloat MaxValue { get; }

Maximum value for Xui.Core.UI.Layout.Grid.TrackSizeKind.MinMax and Xui.Core.UI.Layout.Grid.TrackSizeKind.FitContent tracks.

TrackSize TrackSize.MinContent

public static readonly TrackSize MinContent;

The track is sized to the smallest size that fits its content without overflow. Equivalent to CSS min-content.

TrackSize TrackSize.MinMax(NFloat min, NFloat max)

public static TrackSize MinMax(nfloat min, nfloat max);

Creates a minmax(min, max) track with pixel min and max values.

NFloat TrackSize.MinValue

public nfloat MinValue { get; }

Minimum value for Xui.Core.UI.Layout.Grid.TrackSizeKind.MinMax tracks.

TrackSize TrackSize.Px(NFloat px)

public static TrackSize Px(nfloat px);

Creates a track of an exact pixel length.

string TrackSize.ToString()

public override string ToString();

Returns the fully qualified type name of this instance.

Returns: The fully qualified type name.

NFloat TrackSize.Value

public nfloat Value { get; }

Pixel length for the track.

TrackSize.implicit operator TrackSize(double px)

public static implicit operator TrackSize(double px);

Implicitly converts a pixel value to a Xui.Core.UI.Layout.Grid.TrackSizeKind.Length track.

TrackSize.implicit operator TrackSize(int px)

public static implicit operator TrackSize(int px);

Implicitly converts a pixel value to a Xui.Core.UI.Layout.Grid.TrackSizeKind.Length track.

TrackSize.implicit operator TrackSize(NFloat px)

public static implicit operator TrackSize(nfloat px);

Implicitly converts a pixel value to a Xui.Core.UI.Layout.Grid.TrackSizeKind.Length track.

TrackSize.implicit operator TrackSize(float px)

public static implicit operator TrackSize(float px);

Implicitly converts a pixel value to a Xui.Core.UI.Layout.Grid.TrackSizeKind.Length track.

enum Grid.TrackSizeKind

Identifies the kind of sizing function a Xui.Core.UI.Layout.Grid.TrackSize represents.

public enum TrackSizeKind : byte
{
    Auto = 0,
    MinContent = 1,
    MaxContent = 2,
    Length = 3,
    Fr = 4,
    MinMax = 5,
    FitContent = 6,
}

TrackSizeKind.Auto

Auto = 0

Sized to available space (auto).

TrackSizeKind.FitContent

FitContent = 6

Like Xui.Core.UI.Layout.Grid.TrackSizeKind.MaxContent but clamped to a maximum (fit-content()).

TrackSizeKind.Fr

Fr = 4

Flexible fractional unit (fr).

TrackSizeKind.Length

Length = 3

Fixed pixel length.

TrackSizeKind.MaxContent

MaxContent = 2

Sized to largest content contribution (max-content).

TrackSizeKind.MinContent

MinContent = 1

Sized to smallest content contribution (min-content).

TrackSizeKind.MinMax

MinMax = 5

Clamped between a min and a max (minmax()).