getFlexClass()function

getFlexClass(variants: FlexVariants): string
ParamType
variantsFlexVariants
Variant props for flex layout — opt-in modifiers any component can mix in via getFlexClass(). required
    .wrapboolean
Wrap overflowing elements onto the next line.
    .nowrapboolean
Overflowing elements do not wrap onto the next line.
    .columnboolean
Display the elements as a column (defaults to row).
    .reverseboolean
Reverse the order of the elements.
    .stretchboolean
Rows: Justify the elements across to stretch across the full width (this is the default for rows) (primary axis).
Columns: Justify the elements across to stretch across the full height (this is the default for columns) (primary axis).
    .betweenboolean
Rows: Justify the elements with space between them (primary axis).
Columns: Justify the elements with space between them (primary axis).
    .aroundboolean
Rows: Justify the elements with space around them (primary axis).
Columns: Justify the elements with space around them (primary axis).
    .leftboolean
Rows: Justify the elements to the left (primary axis).
Columns: Align the elements to the left (secondary axis).
    .centerboolean
Rows: Justify the elements to the center (primary axis).
Columns: Align the elements to the center (secondary axis).
    .rightboolean
Rows: Justify the elements to the right (primary axis).
Columns: Align the elements to the right (secondary axis).
    .topboolean
Rows: Align the elements to the top (secondary axis).
Columns: Justify the elements to the top (primary axis).
    .middleboolean
Rows: Align the elements to the middle (secondary axis).
Columns: Justify the elements to the middle (primary axis).
    .bottomboolean
Rows: Align the elements to the bottom (secondary axis).
Columns: Justify the elements to the bottom (primary axis).
    .baselineboolean
Rows: Align the text baselines of the elements (in rows or columns)
Columns: Not-applicable, has no effect.
Return
string
The combined flex + gap class string.

Get the flex layout class for a component from its flex variant props.

  • Composes the gap prop so <Flex gap="large"> etc. just works.

Examples

getFlexClass({ column: true, center: true, gap: "large" })