Class TwFlex
- Namespace
- TwBlazor.Components
- Assembly
- TwBlazor.dll
Lays out its children in a row or a column with CSS flexbox: direction (changing at any breakpoint), wrapping, alignment, gaps and dividers between children.
public class TwFlex : TwLayoutComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent
- Inheritance
-
TwFlex
- Implements
- Inherited Members
Remarks
Reversing the direction changes only where children are drawn. Screen readers and the Tab key still follow the markup, so keep the markup in reading order.
Constructors
TwFlex()
public TwFlex()
Properties
Align
Gets or sets how children are aligned on the cross axis.
[Parameter]
public AlignItems? Align { get; set; }
Property Value
AlignContent
Gets or sets how wrapped lines are spaced on the cross axis. Only has an effect when children wrap.
[Parameter]
public AlignContent? AlignContent { get; set; }
Property Value
ColGap
Gets or sets the space between columns as a step on Tailwind's spacing scale, such as 5 for
gap-x-5. It takes the place of Gap between columns.
[Parameter]
public double? ColGap { get; set; }
Property Value
Direction
Gets or sets the direction at every width. Leave it unset for the browser default, a row.
[Parameter]
public FlexDirection? Direction { get; set; }
Property Value
DirectionLg
Gets or sets the direction from the lg breakpoint (64rem) upwards.
[Parameter]
public FlexDirection? DirectionLg { get; set; }
Property Value
DirectionMd
Gets or sets the direction from the md breakpoint (48rem) upwards.
[Parameter]
public FlexDirection? DirectionMd { get; set; }
Property Value
DirectionSm
Gets or sets the direction from the sm breakpoint (40rem) upwards.
[Parameter]
public FlexDirection? DirectionSm { get; set; }
Property Value
DirectionXl
Gets or sets the direction from the xl breakpoint (80rem) upwards.
[Parameter]
public FlexDirection? DirectionXl { get; set; }
Property Value
DirectionXl2
Gets or sets the direction from the 2xl breakpoint (96rem) upwards.
[Parameter]
public FlexDirection? DirectionXl2 { get; set; }
Property Value
Divided
Gets or sets whether a line is drawn between children: across a column, or down a row. The line follows Direction, not the responsive directions.
[Parameter]
public bool Divided { get; set; }
Property Value
FullHeight
Gets or sets whether the layout fills its parent's height, for example to push a button to the bottom of a card.
[Parameter]
public bool FullHeight { get; set; }
Property Value
FullWidth
Gets or sets whether the layout fills its parent's width.
[Parameter]
public bool FullWidth { get; set; }
Property Value
Gap
Gets or sets the space between children as a step on Tailwind's spacing scale, such as 4 for gap-4.
[Parameter]
public double? Gap { get; set; }
Property Value
Inline
Gets or sets whether the layout is inline, sitting in a line of text instead of taking a line of its own.
[Parameter]
public bool Inline { get; set; }
Property Value
Justify
Gets or sets how children are spaced along the main axis.
[Parameter]
public JustifyContent? Justify { get; set; }
Property Value
RowGap
Gets or sets the space between rows as a step on Tailwind's spacing scale, such as 1 for
gap-y-1. It takes the place of Gap between rows.
[Parameter]
public double? RowGap { get; set; }
Property Value
Wrap
Gets or sets whether children wrap onto new lines. Leave it unset for the browser default, no wrapping.
[Parameter]
public FlexWrap? Wrap { get; set; }
Property Value
rootClasses
Gets the classes for the rendered element, with Class merged last.
protected override string rootClasses { get; }
Property Value
Methods
BuildContent(RenderTreeBuilder)
Renders the content inside the element. Override it to wrap ChildContent, for example in a cascading value; sequence numbers from 8 upwards are free.
protected override void BuildContent(RenderTreeBuilder builder)
Parameters
builderRenderTreeBuilderThe render tree builder, positioned inside the element.