getFlexClass()function
getFlexClass(variants: FlexVariants): string
| Param | Type | |
|---|---|---|
variants | FlexVariants | Variant props for flex layout — opt-in modifiers any component can mix in via getFlexClass(). required |
.wrap | boolean | Wrap overflowing elements onto the next line. |
.nowrap | boolean | Overflowing elements do not wrap onto the next line. |
.column | boolean | Display the elements as a column (defaults to row). |
.reverse | boolean | Reverse the order of the elements. |
.stretch | boolean | 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). |
.between | boolean | Rows: Justify the elements with space between them (primary axis). Columns: Justify the elements with space between them (primary axis). |
.around | boolean | Rows: Justify the elements with space around them (primary axis). Columns: Justify the elements with space around them (primary axis). |
.left | boolean | Rows: Justify the elements to the left (primary axis). Columns: Align the elements to the left (secondary axis). |
.center | boolean | Rows: Justify the elements to the center (primary axis). Columns: Align the elements to the center (secondary axis). |
.right | boolean | Rows: Justify the elements to the right (primary axis). Columns: Align the elements to the right (secondary axis). |
.top | boolean | Rows: Align the elements to the top (secondary axis). Columns: Justify the elements to the top (primary axis). |
.middle | boolean | Rows: Align the elements to the middle (secondary axis). Columns: Justify the elements to the middle (primary axis). |
.bottom | boolean | Rows: Align the elements to the bottom (secondary axis). Columns: Justify the elements to the bottom (primary axis). |
.baseline | boolean | 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
gapprop so<Flex gap="large">etc. just works.
Examples
getFlexClass({ column: true, center: true, gap: "large" })