Skip to content

Align Items

Align items along the cross axis

Syntax

layout="items:[value]"

Values

ValueCSS OutputDescription
startalign-items: flex-startAlign to start
endalign-items: flex-endAlign to end
centeralign-items: centerCenter items
baselinealign-items: baselineAlign to baseline
stretchalign-items: stretchStretch items

Examples

html
<div layout="flex items:center">Centered</div>

Preview

Items Center

layout="items:center" - Items centered along cross axis

ShortTallShort
View Code
html
<div layout="flex items:center" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium" style="height: 100px;">
  <span space="p:small" visual="bg:primary text:white rounded:small">Short</span>
  <span space="p:large" visual="bg:primary text:white rounded:small">Tall</span>
  <span space="p:small" visual="bg:primary text:white rounded:small">Short</span>
</div>

Items Start

layout="items:start" - Items aligned to the start of cross axis

ShortTallShort
View Code
html
<div layout="flex items:start" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium" style="height: 100px;">
  <span space="p:small" visual="bg:primary text:white rounded:small">Short</span>
  <span space="p:large" visual="bg:primary text:white rounded:small">Tall</span>
  <span space="p:small" visual="bg:primary text:white rounded:small">Short</span>
</div>

Items Stretch

layout="items:stretch" - Items stretched to fill container height

123
View Code
html
<div layout="flex items:stretch" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium" style="height: 100px;">
  <span layout="flex center" space="p:small" visual="bg:primary text:white rounded:small">1</span>
  <span layout="flex center" space="p:small" visual="bg:primary text:white rounded:small">2</span>
  <span layout="flex center" space="p:small" visual="bg:primary text:white rounded:small">3</span>
</div>