Skip to main content

Flex

The ty-flex component leverages the power of CSS Flexbox to provide a simple yet flexible container for creating layouts. It allows for easy alignment, spacing, and distribution of child elements.

Usage

Use ty-flex to create layouts with various flex properties:

Live Editor
<ty-flex
  direction="row"
  justify="space-between"
  align="center"
  wrap="wrap"
  gap="10px"
>
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</ty-flex>
Result
Loading...

API

Properties

NameDescriptionTypeDefault
directionFlex direction ('row', 'column', etc.)String'row'
justifyJustification of items ('center', 'space-around', etc.)String'flex-start'
alignAlignment of items ('stretch', 'center', etc.)String'stretch'
wrapWrap behavior ('wrap', 'nowrap')String'nowrap'
gapSpacing between itemsString'0'