Table of Contents

Class FlexBox

Namespace
Xui.Core.UI.Layout
Assembly
Xui.Core.dll

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

public class FlexBox : ViewCollection, ILayerHost, IServiceProvider
Inheritance
FlexBox
Implements
Inherited Members
Extension Methods

Fields

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.

public static readonly View.Extra<NFloat> Basis

Field Value

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).

public static readonly View.Extra<NFloat> Grow

Field Value

View.Extra<NFloat>

Order

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

public static readonly View.Extra<nint> Order

Field Value

View.Extra<nint>

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).

public static readonly View.Extra<NFloat> Shrink

Field Value

View.Extra<NFloat>

Properties

ColumnGap

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

public NFloat ColumnGap { get; set; }

Property Value

NFloat

FlexAlignContent

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

public FlexBox.AlignContent FlexAlignContent { get; set; }

Property Value

FlexBox.AlignContent

FlexAlignItems

Sets the default cross-axis alignment for all flex items on a line. Corresponds to align-items. Default is Stretch.

public FlexBox.AlignItems FlexAlignItems { get; set; }

Property Value

FlexBox.AlignItems

FlexDirection

Sets the main axis direction along which flex items are placed. Corresponds to flex-direction. Default is Row.

public FlexBox.Direction FlexDirection { get; set; }

Property Value

FlexBox.Direction

FlexJustifyContent

Aligns flex items along the main axis when there is free space. Corresponds to justify-content. Default is FlexStart.

public FlexBox.JustifyContent FlexJustifyContent { get; set; }

Property Value

FlexBox.JustifyContent

FlexWrap

Controls whether flex items wrap onto multiple lines. Corresponds to flex-wrap. Default is NoWrap.

public FlexBox.Wrap FlexWrap { get; set; }

Property Value

FlexBox.Wrap

RowGap

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

public NFloat RowGap { get; set; }

Property Value

NFloat