Skip to content

Layouts

Stack

Bit.BlazorUIWrapPanel

A Stack is a container-type component that abstracts the implementation of a flexbox in order to define the layout of its children components. It lays them out in a single direction - a column by default, a row with Horizontal - puts a Gap between them and places them on each of the two axes by name through HorizontalAlign and VerticalAlign, so the same parameter means the same thing whichever way the stack faces. Beyond that it sizes those children (FillContent, GrowContent, EqualContent, NoShrinkContent) and itself (Auto and Fit), behaves as a child of another stack (Grow, Basis, Shrink, Shrinkable, Self, Order), and answers to the width of the window through HorizontalXs to HorizontalXxl, which the two alignments follow, GapXs to GapXxl - per axis with HorizontalGapXs to VerticalGapXxl - and WrapXs to WrapXxl.

Usage

Every example is live. Open its code to see exactly what produced the component running underneath.

Basic

A stack is a flex container with a gap. By default it stacks its children in a column, and Horizontal lays them out in a row instead. Reversed paints them from the far end back towards the near one - bottom-to-top in a column, end-to-start in a row - which only changes the painted order: the order the content is read in by a screen reader and reached in by the keyboard stays the order it is written in.
Default (vertical)
Item 1
Item 2
Item 3

Horizontal
Item 1
Item 2
Item 3

Reversed vertical
Item 1
Item 2
Item 3

Reversed horizontal
Item 1
Item 2
Item 3

Gap

Gap is the room between the children, in any CSS length (0.5rem, 8px, 2%, var(--my-gap)), and it defaults to 1rem. It is created with the CSS gap rather than with margins on the children, so it never appears before the first child or after the last one and it survives a child being hidden. HorizontalGap and VerticalGap each replace it on a single axis, which is what a wrapping stack that needs more air between its rows than between its columns wants, and GapXs to GapXxl - and, per axis, HorizontalGapXs to VerticalGapXxl, shown in the Responsive section - replace it per breakpoint. The room is left empty; drawing a line in it is a BitSeparator placed between the two children it separates, which is a child of the stack like any other and is spaced by the same gap on both of its sides.
1.0 rem

Item 1
Item 2
Item 3

Per axis (HorizontalGap 2rem, VerticalGap 0.25rem)
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
Item 10
Item 11
Item 12

A BitSeparator drawn in the room the gap leaves
Item 1
Item 2

Alignment

HorizontalAlign and VerticalAlign place the children by axis rather than by the flexbox property that happens to reach that axis, so each of them keeps meaning the same thing when the stack changes direction. On the axis the children are laid out along, all of Start, Center, End and the three space distributions apply; on the axis across them, Start, Center, End, Baseline and Stretch do. A value that means nothing on the axis it lands on is dropped and steps aside for Alignment, the shorthand that sets both axes at once. These place all of the children at once; pushing a single one of them - the actions at the end of a toolbar, say - away from the rest is a BitSpacer between the two groups instead.

Direction

Horizontal Align

Vertical Align

Item 1
Item 2
Item 3

Alignment: both axes at once, which is the whole of centering something
Centered

Wrap

Without Wrap the children of a stack are squeezed to fit rather than moved, which is what a toolbar that must never break wants and what a row of chips does not. WrapReverse wraps the other way, laying the rows out from the far edge of the stack back towards the near one. Once there is more than one row and the stack is larger than they are, AlignContent is what decides where those rows sit - it is the only alignment that acts on the rows themselves rather than on the children within a row. WrapXs to WrapXxl answer the question per breakpoint, with Wrap as the base of that chain, so a row that breaks onto a second line on a phone and holds its single line on a desktop is those two parameters and nothing else; WrapReverse stays outside the chain and is the way every breakpoint that wraps wraps.
15.0 rem

Align Content


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Per breakpoint: this row wraps below md (960px) and holds its single line from it upwards, where what no longer fits is squeezed instead
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Responsive

HorizontalXs to HorizontalXxl give the stack a direction per breakpoint: true lays the children out in a row and false in a column, and each value keeps applying to every wider breakpoint until another one replaces it. That makes the column-on-a-phone, row-on-a-desktop layout a single parameter instead of a media query, and it leaves Horizontal as the base of the chain for any width none of them reach. HorizontalAlign and VerticalAlign follow the direction each breakpoint gives, so they keep naming the same axis of the screen at every width and the stack is realigned along with it - including which of their values mean anything on the axis they land on there. GapXs to GapXxl are the same chain for the spacing, with Gap as their base, which is what a stack that folds into a column and wants less room between its children there is written as. HorizontalGapXs to HorizontalGapXxl and VerticalGapXs to VerticalGapXxl are one more chain each, for the wrapping stack whose rows and columns want to change by different amounts; a breakpoint neither of them names falls back to whatever the Gap chain resolves to there, so only the axis that needs its own answer has to be written out. WrapXs to WrapXxl, shown in the Wrap section, are one more chain of the same shape, for the row that may break onto a second line at some widths and not at others. Reversed and WrapReverse are not part of any of these chains: each of them says which way round, and that is the same answer at every width. Narrow the window to below 960px to watch the stacks fold into columns.
Column below md (960px), row from it upwards
Item 1
Item 2
Item 3

Row below lg (1280px), column from it upwards
Item 1
Item 2
Item 3

One pair of alignments (HorizontalAlign SpaceBetween, VerticalAlign Center) at both directions: as a column the children are centered down the stack, since spreading them is meaningless across it; as a row they are spread along it and centered across it
Item 1
Item 2
Item 3

Direction and spacing together: a column with a 0.25rem gap below md, a row with a 3rem one from it upwards
Item 1
Item 2
Item 3

One axis at a time: the rows of this wrapping stack keep the 0.5rem the Gap chain gives them at every width, while its columns open from 0.5rem to 3rem at md and to 5rem at lg
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8

Nesting

A stack is a flex container and a flex child at the same time, so nesting one inside another is how a real layout is built: the outer stack decides the direction and the spacing of its parts, and each inner stack does the same for its own. Every stack keeps its own parameters - the ones below alternate direction at each level - and a nested stack claims only the space its parent gives it.
Item 1
Item 2-1
Item 2-2
Item 2-3
Item 3-1
Item 3-2
Item 3-3

Content sizing

The four parameters that act on the children instead of on the stack. FillContent expands every direct child across the axis they are not laid out along - the full width in a column, the full height in a row - which is what a menu or a sidebar of equally wide items wants; the size is forced, so a child that stated one of its own is overridden. On a stack that wraps, or one that changes direction with the width of the window, it fills the row each child landed on rather than the whole stack, as a stretch that leaves a stated size alone. The other three act along that axis: GrowContent lays the children out at their natural size and shares what is left over between them, so a child that holds more stays larger; EqualContent takes their content out of the sum instead, so a row of three ends up in exact thirds whatever each of them holds; and NoShrinkContent keeps them at their own size when the stack runs out of room, so what no longer fits overflows it - or wraps, with Wrap - rather than being crushed into it. FillContent is on the other axis from all three, so it combines with any of them.
FillContent (cross axis)
Item 1
Item 2
Item 3

GrowContent (main axis): the leftover shared out, so the longer child stays longer
Item 1
A much longer item 2
Item 3

EqualContent (main axis): exact thirds instead
Item 1
A much longer item 2
Item 3

FillContent and GrowContent together
Item 1
Item 2
Item 3

Eight squares in a row too narrow for them: squeezed to fit
1
2
3
4
5
6
7
8

NoShrinkContent: kept at their own size, and what no longer fits overflows
1
2
3
4
5
6
7
8

Sizing

A stack fills its container on both axes by default, which is what a stack that lays a page or a panel out wants and what a stack of a few rows sitting inside a taller box does not. AutoWidth, AutoHeight and the AutoSize shorthand hand that axis back to the content. FitWidth, FitHeight and FitSize do the same but with a definite size, so unlike the automatic ones they also hold when the stack is a child of another flex container that stretches its children - which is what the dotted row below does.
In a plain block: the default fills the width, AutoWidth hands it back
Default

AutoWidth

Inside a row that stretches its children: only the fitted height holds
AutoHeight
FitHeight
FitSize

As a flex item

These eight describe the stack as a child of another flex container rather than as a container itself, so they only say something inside a parent that has room to share out - most often another stack. Grow is the flex-grow factor and Grows is the same thing with the factor every layout reaches for first, so the three nested stacks below take three sixths, two sixths and one sixth of whatever their row has left over. Basis is the size that sharing starts from, and a basis of 0 takes the content of a stack out of the sum, which is how a row of equal columns is built out of stacks that hold different amounts. NoShrink takes a stack out of being squeezed when the room runs out, so the space has to come from its siblings instead, and Shrink is the same thing with a factor of its own - the mirror of Grow for a shortage rather than a leftover. Shrinkable is the other end of the same story: a flex child is never squeezed below its own content unless it is told it may, which is why a nested stack refuses to shrink far enough for the label inside it to be truncated with an ellipsis, and this is what lifts that floor on both axes. Self places this one stack across the axis of its parent, overriding for it alone whatever the parent aligns its children with, and Order moves it among its siblings visually while leaving the reading and tab order untouched.
Grow & Grows
Grow 3
Grow 2
Grows

Grows alone, then with a Basis of 0: the same three stacks, sized by what they hold and then equally
One
The second one
Three

One
The second one
Three

Shrink: three stacks of 12rem in a row of 24rem, giving up what it is short of by their factor
Shrink 3
Default
NoShrink

NoShrink: drag the handle at the corner to squeeze the row
Shrinks away
Never shrinks
Shrinks away

Shrinkable: the same nested stack without and with the floor its own content puts under it
A very long label that has nowhere near enough room to be shown in full
Fixed

A very long label that has nowhere near enough room to be shown in full
Fixed

Self & Order
Self Start
Centered
Self End
Order -1 (written last)

Padding

Padding is the room between the border of the stack and its children, and it takes the CSS shorthand in full: one length pads every side, two pad the block and then the inline axis, and four pad each side in turn. The stack is sized border-box, so the padding is taken out of the size it already has rather than added to it, and a padded stack still fits exactly where an unpadded one did. There is no per breakpoint chain for it as there is for the direction and the spacing: a padding that answers to the width of the window is a fluid length such as clamp(0.5rem, 2vw, 2rem), which follows the viewport without a breakpoint at all.
Padding 1rem
Padding 2rem 0.5rem

A fluid padding: narrow the window to watch it close up
Padding clamp(0.5rem, 2vw, 2rem)

Element & Inline

The stack renders a div, and Element swaps that tag for any other one, which is how a stack of things that form a list becomes a ul or a region of the page becomes a nav. Only the tag name changes - the layout is untouched - so a landmark element given here is worth pairing with an AriaLabel that names it. A stack rendered as a ul, an ol or a menu is also given a role="list" of its own, since some browsers stop reporting those elements as lists as soon as they are laid out as a flex container; a role among the splatted html attributes still replaces it. Inline changes the box the stack itself is rather than its tag: an inline stack flows with the text around it and is sized by its content instead of by the box around it, which is what a group of chips or of icons sitting inside a sentence, a table cell or a label needs. A size given through Style or through the Fit and Auto parameters still wins over that.

A list, whose children are the li elements that belong in one
  • First
  • Second
  • Third

An inline stack
flows
with
the text around it.

Size

Size is the gap picked from the spacing scale of the theme instead of being written out by hand, in the usual three steps: Small, Medium and Large. It is the parameter to reach for when the layouts of an application should stay on the rhythm of its theme, since the length it resolves to follows the spacing unit and the density of the current theme and changes along with them. The more specific Gap, HorizontalGap and VerticalGap each win over it on the axis they target.
Small
Small
Small

Medium
Medium
Medium

Large
Large
Large

Style & Class

The stack renders a single element, so Style and Class land straight on it. The inline styles are appended after the ones the component generates, so they win over them - which is how a stack is given a height, a background or a border without a class at all. The one declaration that is deliberately hard to reach is the display, since a stack that is not a flex container is not a stack. Everything the parameters of the stack already cover - the gap, the padding, the direction, the sizing - is worth reaching for there first, since those are resolved per breakpoint and per theme where a hardcoded declaration is not.
Style
on the stack

Class
on the stack

RTL

A horizontal stack runs along the text direction, so marking it right-to-left with Dir mirrors it: the children begin at the right edge, and HorizontalAlign keeps meaning "towards the edge the children begin at" rather than a fixed side of the screen. Reversed composes with it and flips that back again. A vertical stack lays its children out top to bottom either way, so only the alignment across it moves.
Horizontal, right-to-left
یک
دو
سه

Horizontal, right-to-left and reversed
یک
دو
سه

Vertical, right-to-left, aligned to the end of the horizontal axis
یک
دو
سه

API

Every parameter, public member, sub-class and enum this component exposes.

BitStack parameters

Name Type Default value Description
AlignContent BitAlignment? null Gets or sets how the rows of a wrapping stack share out the room left over on the cross axis (the CSS align-content). It only says something once Wrap has produced more than one row and the stack is larger than those rows across. Baseline has no meaning for align-content on a flex container and is dropped.
Alignment BitAlignment? null Gets or sets the alignment of the children of the stack on both axes at once. This is the shorthand of setting HorizontalAlign and VerticalAlign to the same value, and each of those takes precedence over it on its own axis. A specific alignment that means nothing on the axis it was given to steps aside for this shorthand rather than silencing it.
AutoHeight bool false Makes the height of the stack follow its content instead of filling its parent.
AutoSize bool false Makes both the width and the height of the stack follow its content instead of filling its parent. This is the shorthand of setting AutoWidth and AutoHeight together.
AutoWidth bool false Makes the width of the stack follow its content instead of filling its parent.
Basis string? null Gets or sets the size this stack starts from before the leftover space of its own container is shared out (the CSS flex-basis), measured along the axis of that container. A basis of 0 takes the content of the stack out of the sum, so several stacks that also grow end up the same size as each other however much each of them holds.
ChildContent RenderFragment? null The content of the stack.
Element string? null Gets or sets the custom html element used for the root node, "div" by default. Only the tag name changes, and with it the semantics reported to assistive technologies, so a landmark element given here is worth pairing with an AriaLabel that names it. A stack rendered as a ul, an ol or a menu is also given an explicit list role, since some browsers drop the list semantics of those elements as soon as they are laid out as a flex container, and a role among the splatted html attributes still replaces it.
EqualContent bool false Gives every direct child of the stack an equal share of the axis they are laid out along, whatever each of them holds, so a row of three ends up in exact thirds. That is the difference from GrowContent, which lays the children out at their natural size first and only shares out what is left over.
FillContent bool false Expands the direct children of the stack across the axis they are not laid out along: the full width in a column and the full height in a row. The size is forced, so a child that states a size of its own across that axis is overridden. A wrapping stack, and one whose direction changes with the width of the window, fills the row each child landed on instead, as a stretch that leaves a child that stated a size alone. Sharing the other axis out between the children is what GrowContent does, and the two combine.
FitHeight bool false Sets the height of the stack to fit its content. Unlike AutoHeight this also holds when the stack is a child of another flex container that would otherwise stretch it.
FitSize bool false Sets the width and height of the stack to fit its content. This is the shorthand of setting FitWidth and FitHeight together.
FitWidth bool false Sets the width of the stack to fit its content. Unlike AutoWidth this also holds when the stack is a child of another flex container that would otherwise stretch it.
Gap string? null Gets or sets the spacing between the children of the stack, using any CSS length value, 1rem by default. It takes one length for both axes, or two - the vertical one followed by the horizontal one - for a wrapping stack. HorizontalGap and VerticalGap each replace it on their own axis, GapXs to GapXxl each replace it from their own breakpoint upwards, and it takes precedence over the Size picked from the spacing scale of the theme.
GapXs string? null Gets or sets the spacing between the children of the stack from the extra small breakpoint (from 0px) upwards, using any CSS length value. The value keeps applying to every wider breakpoint until another one replaces it, and Gap is the base of that chain. This is the pair of HorizontalXs for the spacing rather than the direction, and the two are most often set together.
GapSm string? null Gets or sets the spacing between the children of the stack from the small breakpoint (from 600px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
GapMd string? null Gets or sets the spacing between the children of the stack from the medium breakpoint (from 960px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
GapLg string? null Gets or sets the spacing between the children of the stack from the large breakpoint (from 1280px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
GapXl string? null Gets or sets the spacing between the children of the stack from the extra large breakpoint (from 1920px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
GapXxl string? null Gets or sets the spacing between the children of the stack from the extra extra large breakpoint (from 2560px) upwards.
Grow string? null Gets or sets how much of the leftover space of its own container this stack takes compared to its siblings (the CSS flex-grow factor). It describes the stack as a child of another flex container, so it needs a parent with room to share out to mean anything, and it takes precedence over Grows.
GrowContent bool false Lets every direct child of the stack grow into the room the stack has left over along the axis they are laid out on, so what is left after they have all been laid out at their natural size is shared out between them equally. A child that holds more therefore stays larger than one that holds less, which is where EqualContent differs. Expanding them across the other axis is what FillContent does, and the two combine.
Grows bool false Makes the stack take the space its own container has left over (a CSS flex-grow factor of 1). This is Grow with the factor every layout reaches for first, and Grow replaces it when both are set.
Horizontal bool false Renders the children of the stack side by side in a row instead of stacked in a column. This is the direction of the stack at every width, and HorizontalXs to HorizontalXxl replace it from their own breakpoint upwards.
HorizontalAlign BitAlignment? null Gets or sets how the children of the stack are placed on the horizontal axis. In a horizontal stack that is the axis they are laid out along, so the space distributions apply and Baseline does not; in a vertical one it is the axis across them, so Baseline and Stretch apply and the space distributions do not. A value that means nothing on the axis it lands on steps aside for Alignment. Which of the two axes this is follows the direction each breakpoint gives, so a stack that changes direction with the width of the window is realigned along with it.
HorizontalGap string? null Gets or sets the spacing between the children of the stack measured along the horizontal axis, using any CSS length value. This is the room between the columns, and it replaces Gap and Size on this axis alone. HorizontalGapXs to HorizontalGapXxl each replace it from their own breakpoint upwards.
HorizontalGapXs string? null Gets or sets the spacing between the children of the stack measured along the horizontal axis from the extra small breakpoint (from 0px) upwards. The value keeps applying to every wider breakpoint until another one replaces it, and HorizontalGap is the base of that chain. A breakpoint this chain never reaches falls back to whatever the Gap chain resolves to there, so only the axis that needs its own answer has to be written out.
HorizontalGapSm string? null Gets or sets the spacing between the children of the stack measured along the horizontal axis from the small breakpoint (from 600px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
HorizontalGapMd string? null Gets or sets the spacing between the children of the stack measured along the horizontal axis from the medium breakpoint (from 960px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
HorizontalGapLg string? null Gets or sets the spacing between the children of the stack measured along the horizontal axis from the large breakpoint (from 1280px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
HorizontalGapXl string? null Gets or sets the spacing between the children of the stack measured along the horizontal axis from the extra large breakpoint (from 1920px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
HorizontalGapXxl string? null Gets or sets the spacing between the children of the stack measured along the horizontal axis from the extra extra large breakpoint (from 2560px) upwards.
HorizontalXs bool? null Gets or sets the direction of the stack from the extra small breakpoint (from 0px) upwards: true lays the children out in a row and false in a column. The value keeps applying to every wider breakpoint until another one replaces it, and Horizontal is the base of that chain. HorizontalAlign and VerticalAlign follow the direction each breakpoint gives, so the stack is realigned along with it.
HorizontalSm bool? null Gets or sets the direction of the stack from the small breakpoint (from 600px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
HorizontalMd bool? null Gets or sets the direction of the stack from the medium breakpoint (from 960px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
HorizontalLg bool? null Gets or sets the direction of the stack from the large breakpoint (from 1280px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
HorizontalXl bool? null Gets or sets the direction of the stack from the extra large breakpoint (from 1920px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
HorizontalXxl bool? null Gets or sets the direction of the stack from the extra extra large breakpoint (from 2560px) upwards.
Inline bool false Renders the stack as an inline box, so it flows with the text around it instead of starting a line of its own and is sized by its content rather than by the box around it. Nothing about the layout of the children changes; only the outside of the stack does, and a size given through Style or through the Fit and Auto parameters still wins.
NoShrink bool false Keeps the stack at its natural size when its own container runs out of room, instead of letting it be squeezed, so the space has to come from its siblings instead. Shrink is the same thing with a factor of its own and takes precedence over it.
NoShrinkContent bool false Keeps every direct child of the stack at its natural size when the stack runs out of room, so what no longer fits overflows the stack - or moves onto another row, if Wrap was asked for - rather than being crushed into it. This is NoShrink applied to the children rather than to the stack itself.
Order int? null Gets or sets the position of the stack among the children of its own container (the CSS order). Only the painted order changes: the order the content is read in by a screen reader and reached in by the keyboard stays the order it is written in.
Padding string? null Gets or sets the inner padding of the stack, using any CSS padding value: one length pads every side, two pad the block and then the inline axis, and four pad each side in turn. The stack is sized border-box, so the padding is taken out of the size it already has rather than added to it. A padding that answers to the width of the window is a fluid length such as clamp(0.5rem, 2vw, 2rem), since there is no per breakpoint chain for it.
Reversed bool false Renders the children of the stack in the opposite direction (bottom-to-top in a vertical stack, and end-to-start in a horizontal one). Only the painted order is reversed: the order the children are read in by a screen reader and reached in by the keyboard stays the order they are written in.
Self BitAlignment? null Gets or sets how the stack itself is placed across the axis of its own container (the CSS align-self), overriding for this one child whatever that container aligns its children with. The three space distributions share room out between several children, which a single child cannot do, so they are ignored.
Shrink string? null Gets or sets how much of what its own container is short of this stack gives up compared to its siblings (the CSS flex-shrink factor). Every flex child answers for a factor of 1 by default, and NoShrink is this with the factor a layout reaches for most, zero.
Shrinkable bool false Lets the stack shrink below the size of what it holds when its own container runs out of room, by lifting the automatic minimum size a flex child has on both axes. That floor is why a nested stack refuses to shrink far enough for the text inside it to be truncated with an ellipsis or for a pane to scroll instead of the page growing. It is about how far the stack may be squeezed, where NoShrink is about whether it is squeezed at all.
Size BitSize? null Gets or sets the spacing between the children of the stack, picked from the spacing scale of the theme, so it follows the spacing unit and the density of the current theme instead of being hardcoded. Gap, HorizontalGap and VerticalGap each take precedence over it on the axis they target.
VerticalAlign BitAlignment? null Gets or sets how the children of the stack are placed on the vertical axis. In a vertical stack that is the axis they are laid out along, so the space distributions apply and Baseline does not; in a horizontal one it is the axis across them, so Baseline and Stretch apply and the space distributions do not. A value that means nothing on the axis it lands on steps aside for Alignment. Which of the two axes this is follows the direction each breakpoint gives, so a stack that changes direction with the width of the window is realigned along with it.
VerticalGap string? null Gets or sets the spacing between the children of the stack measured along the vertical axis, using any CSS length value. This is the room between the rows, and it replaces Gap and Size on this axis alone. VerticalGapXs to VerticalGapXxl each replace it from their own breakpoint upwards.
VerticalGapXs string? null Gets or sets the spacing between the children of the stack measured along the vertical axis from the extra small breakpoint (from 0px) upwards. The value keeps applying to every wider breakpoint until another one replaces it, and VerticalGap is the base of that chain. A breakpoint this chain never reaches falls back to whatever the Gap chain resolves to there, so only the axis that needs its own answer has to be written out.
VerticalGapSm string? null Gets or sets the spacing between the children of the stack measured along the vertical axis from the small breakpoint (from 600px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
VerticalGapMd string? null Gets or sets the spacing between the children of the stack measured along the vertical axis from the medium breakpoint (from 960px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
VerticalGapLg string? null Gets or sets the spacing between the children of the stack measured along the vertical axis from the large breakpoint (from 1280px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
VerticalGapXl string? null Gets or sets the spacing between the children of the stack measured along the vertical axis from the extra large breakpoint (from 1920px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
VerticalGapXxl string? null Gets or sets the spacing between the children of the stack measured along the vertical axis from the extra extra large breakpoint (from 2560px) upwards.
Wrap bool false Lets the children of the stack move onto more rows when they no longer fit on one. Without it they are squeezed to fit rather than moved. AlignContent is what places the rows a wrapping stack produces, and WrapXs to WrapXxl replace this from their own breakpoint upwards.
WrapXs bool? null Gets or sets whether the children of the stack may move onto more rows, from the extra small breakpoint (from 0px) upwards: true lets them wrap and false keeps them on one row. The value keeps applying to every wider breakpoint until another one replaces it, and Wrap is the base of that chain. WrapReverse is not part of it: it is the way every breakpoint that wraps at all wraps.
WrapSm bool? null Gets or sets whether the children of the stack may move onto more rows, from the small breakpoint (from 600px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
WrapMd bool? null Gets or sets whether the children of the stack may move onto more rows, from the medium breakpoint (from 960px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
WrapLg bool? null Gets or sets whether the children of the stack may move onto more rows, from the large breakpoint (from 1280px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
WrapXl bool? null Gets or sets whether the children of the stack may move onto more rows, from the extra large breakpoint (from 1920px) upwards. The value keeps applying to every wider breakpoint until another one replaces it.
WrapXxl bool? null Gets or sets whether the children of the stack may move onto more rows, from the extra extra large breakpoint (from 2560px) upwards.
WrapReverse bool false Lets the children of the stack move onto more rows when they no longer fit on one, with the rows laid out from the far edge of the stack back towards the near one. It takes precedence over Wrap when both are set.

BitComponentBase parameters

Name Type Default value Description
AriaLabel string? null Gets or sets the accessible label for the component, used by assistive technologies.
Class string? null Gets or sets the CSS class name(s) to apply to the rendered element.
Dir BitDir? null Gets or sets the text directionality for the component's content.
ForceAnimation bool false Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested.
HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters.
Id string? null Gets or sets the unique identifier for the component's root element.
IsEnabled bool true Gets or sets a value indicating whether the component is enabled and can respond to user interaction.
Style string? null Gets or sets the CSS style string to apply to the rendered element.
TabIndex string? null Gets or sets the tab order index for the component when navigating with the keyboard.
Visibility BitVisibility BitVisibility.Visible Gets or sets the visibility state (visible, hidden, or collapsed) of the component.

BitComponentBase public members

Name Type Default value Description
UniqueId Guid Guid.NewGuid() Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed.
RootElement ElementReference Gets the reference to the root HTML element associated with this component.

BitAlignment enum

Name Value Description
Start 0 Packs the children against the edge the stack begins at.
End 1 Packs the children against the edge the stack ends at.
Center 2 Centers the children on the axis.
SpaceBetween 3 Puts the whole of the leftover room between the children, leaving none at either end.
SpaceAround 4 Gives each child an equal share of the leftover room on both of its sides, so the ends get half of what sits between two children.
SpaceEvenly 5 Makes every gap equal, the two at the ends included.
Baseline 6 Lines the children up on the first line of text of each of them.
Stretch 7 Grows the children until they fill the axis.

BitSize enum

Name Value Description
Small 0 The small size.
Medium 1 The medium size.
Large 2 The large size.

BitVisibility enum

Name Value Description
Visible 0 The content of the component is visible.
Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
Collapsed 2 The component is hidden (display:none).

BitDir enum

Name Value Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.