Backpack UI
Components
Flex

Flex and FlexItem

Flex and FlexItem components are used to create a flexible layout system.

Import components

To use the Flex and FlexItem components, you need to import them from the @ef-global/backpack package:


_10
import { Flex, FlexItem } from '@ef-global/backpack/Flex';

Usage

Here are some examples of how to use the Flex and FlexItem components:

Flex Container


_10
<Flex direction="row" gap="m" align="center" justify="center">
_10
// Your content
_10
</Flex>

Flex Item


_10
<FlexItem flex="auto" align="center" justify="center">
_10
// Your content
_10
</FlexItem>

Props

Flex

PropTypeAccepted ValuesDescription
childrenReactNode-The content to be displayed inside the flex container.
directionFlexDirection'row', 'column'The direction of the flex container.
gapFlexGapValues'', 'xxs', 'xs', 's', 'm', 'l', 'xl'The gap between the flex items.
alignFlexAlignValues'flex-start', 'center', 'flex-end', 'space-between', 'space-evenly'The alignment of the flex items.
justifyFlexJustifyValues'flex-start', 'center', 'flex-end', 'space-between', 'space-evenly'The justification of the flex items.
classNamestring-Custom classname to apply additional CSS styles.
styleCSSProperties-Inline styles for the flex container.

FlexItem

PropTypeAccepted ValuesDescription
childrenReactNode-The content to be displayed inside the flex item.
flexFlexItemKeys'none', 'auto', 'grow', 'shrink'The flex property for the flex item.
alignFlexItemAlignKeys'start', 'center', 'end'The alignment of the flex item.
justifyFlexItemAlignKeys'start', 'center', 'end'The justification of the flex item.
widthstring-The width of the flex item (in percentages).
classNamestring-Custom classname to apply additional CSS styles.