Skip to main content
Elastic UI
Elastic UI
Getting startedComponentsPatternsContentData visualization
EUI ChangelogGitHubFigma
  • Overview
  • Layout
    • Flex
      • Flex groups
      • Flex items
      • Flex grids
    • Header
    • Horizontal rule
    • Page components
    • Page header
    • Spacer
  • Containers
  • Navigation
  • Display
  • Forms
  • Tabular content
  • Templates
  • Editors and syntax
  • EUI
  • Layout
  • Flex
  • Flex grids

Flex grids

Coloring and padding exist for examples only

Padding and background-color are added to all EuiFlexItems on this documentation page for illustrative purposes only. If needed, you must add your own padding through additional components or classes.

EuiFlexGrid is a more rigid component, used for repeatable rows of same-width items. You can set a

columns prop to specify anywhere between 1-4 columns. Any more would likely break on laptop screens.

Loading...

Responsive flex grids

EuiFlexGrid is responsive by default, stacking items vertically on smaller screens. Should you want to customize the number of items on small or large screens, apply the responsive={false} prop and then conditionally pass a column number based on the current breakpoint.

Loading...

Display customization

Align

Flex grids support vertically aligning children via the alignItems prop. Unlike flex groups, they do not support justifyContent, as grid columns are always evenly distributed.

Loading...

Gutter sizing

The gutterSize prop can be applied to a parent EuiFlexGrid to adjust the spacing between child EuiFlexItems.

Loading...

Changing direction

Adding direction="column" will re-orient the flex items so they display top-down then left to right.

Loading...

Props

EuiFlexGrid

Extends HTMLAttributes
𐘂𐘂
✄𐘗✄𐘗
Prop
↦
Description and type
↦
Default value
↵
Prop
className#
↦
Description and type
Type: string
↦
Default value
↵
Prop
aria-label#
↦
Description and type

Defines a string value that labels the current element.
@see aria-labelledby.

Type: string
↦
Default value
↵
Prop
data-test-subj#
↦
Description and type
Type: string
↦
Default value
↵
Prop
css#
↦
Description and type
Type: Interpolation<Theme>
↦
Default value
↵
Prop
children#
↦
Description and type

ReactNode to render as this component's content

Type: ReactNode
↦
Default value
↵
Prop
columns#
↦
Description and type

Number of columns. Accepts 1-4

Type: 2 | 3 | 1 | 4
↦
Default value
1
↵
Prop
direction#
↦
Description and type

Flex layouts default to left-right then top-down (row).
Change this prop to column to create a top-down then left-right display.

Type: "column" | "row"
↦
Default value
row
↵
Prop
alignItems#
↦
Description and type

Aligns grid items vertically

Type: "center" | "stretch" | "end" | "start" | "baseline"
↦
Default value
stretch
↵
Prop
gutterSize#
↦
Description and type

Space between flex items

Type: "s" | "m" | "l" | "xl" | "none"
↦
Default value
l
↵
Prop
responsive#
↦
Description and type

Will display each item at full-width on smaller screens

Type: boolean
↦
Default value
true
↵
Prop
component#
↦
Description and type

The tag to render

Type: ElementType
↦
Default value
div
↵
𐘂𐘂
Edit this page

Previous
Flex items
Next
Header
  • Responsive flex grids
  • Display customization
    • Align
    • Gutter sizing
    • Changing direction
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic