Package org.patternfly.layout.flex
package org.patternfly.layout.flex
Provides the PatternFly flex layout for building custom layouts with full control over spacing, direction, alignment,
justification, wrapping, and width.
A flex layout with custom spacing and responsive direction:
The flex layout utilizes the PatternFly spacer and breakpoint systems to create completely custom layouts. It supports nesting flex containers, individual item spacing, responsive breakpoints, and various alignment and justification options.
Usage
A basic flex layout with items:import static org.patternfly.layout.flex.Flex.flex;
import static org.patternfly.layout.flex.FlexItem.flexItem;
flex()
.addItem(flexItem().text("Flex item"))
.addItem(flexItem().text("Flex item"))
.addItem(flexItem().text("Flex item"));
import static org.patternfly.layout.flex.Flex.flex;
import static org.patternfly.layout.flex.FlexItem.flexItem;
import static org.patternfly.style.Breakpoint.default_;
import static org.patternfly.style.Breakpoint.lg;
import static org.patternfly.style.Breakpoints.breakpoints;
flex()
.direction(breakpoints(default_, Direction.column, lg, Direction.row))
.spaceItems(breakpoints(default_, SpaceItems.md))
.addItem(flexItem().text("Item 1"))
.addItem(flexItem().text("Item 2"))
.addItem(flexItem().text("Item 3"));
- See Also:
-
ClassDescriptionDefines the alignment property values for a
Flexlayout.Defines the align-content property values for aFlexlayout.Defines the align-items property values for aFlexlayout.Defines the align-self property values for aFlexlayout.Defines the flex-direction property values for aFlexlayout.Defines the display property values for aFlexlayout.The flex layout supports a completely custom layout by utilizing the PatternFly spacer and breakpoint systems.An item within aFlexlayout container.Defines the flex shorthand property values for aFlexlayout.Defines the flex-wrap property values for aFlexlayout.Defines the gap property values for aFlexlayout.Defines the justify-content property values for aFlexlayout.Defines the space-items property values for aFlexlayout.Defines the spacer property values for aFlexlayout.