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.

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"));
A flex layout with custom spacing and responsive direction:
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:
  • Class
    Description
    Defines the alignment property values for a Flex layout.
    Defines the align-content property values for a Flex layout.
    Defines the align-items property values for a Flex layout.
    Defines the align-self property values for a Flex layout.
    Defines the flex-direction property values for a Flex layout.
    Defines the display property values for a Flex layout.
    The flex layout supports a completely custom layout by utilizing the PatternFly spacer and breakpoint systems.
    An item within a Flex layout container.
    Defines the flex shorthand property values for a Flex layout.
    Defines the flex-wrap property values for a Flex layout.
    Defines the gap property values for a Flex layout.
    Defines the justify-content property values for a Flex layout.
    Defines the space-items property values for a Flex layout.
    Defines the spacer property values for a Flex layout.