Skip to main content
Elastic UI
Elastic UI
ComponentsPatternsContentData visualization
EUI ChangelogGitHubFigma
  • Guidelines
    • Getting started
    • Accessibility
    • Writing
    • Testing
  • Theming
    • Theme provider
    • Color mode
    • High contrast mode
    • Borders
    • Breakpoints
    • Colors
    • Sizing
    • Typography
  • Templates
    • Page template
    • Sitewide search
  • Layout
    • Accordion
    • Bottom bar
    • Flex
      • Flex groups
      • Flex items
      • Flex grids
    • Flyout
    • Header
    • Horizontal rule
    • Modal
    • Page components
    • Page header
    • Panel
    • Popover
    • Resizable container
    • Spacer
  • Navigation
    • Breadcrumbs
    • Buttons
    • Collapsible nav
    • Context menu
    • Facet
    • Key pad menu
    • Link
    • Pagination
    • Side nav
    • Steps
    • Tabs
    • Tree view
  • Display
    • Aspect ratio
    • Avatar
    • Badge
    • Callout
    • Card
    • Comment list
    • Description list
    • Drag and drop
    • Empty prompt
    • Health
    • Icons
    • Image
    • List group
    • Loading
    • Progress
    • Skeleton
    • Stat
    • Text
    • Timeline
    • Title
    • Toast
    • Tooltip
    • Tour
  • Forms
    • Form controls
    • Form layouts
    • Form validation
    • Text controls
    • Numeric controls
    • Selection controls
    • Search and filter controls
    • Date and time controls
    • Other controls
  • Tabular content
    • Tables
    • Data grid
  • Editors & Syntax
    • Code
    • Markdown
  • Utilities
    • Accessibility
    • Auto sizer
    • Beacon
    • Color palettes
    • Copy
    • CSS utility classes
    • Delay
    • Error boundary
    • Focus trap
    • Highlight and mark
    • HTML ID generator
    • I18n
    • Inner text
    • Mutation observer
    • Outside click detector
    • Overlay mask
    • Portal
    • Pretty duration
    • Provider
    • Resize observer
    • Scroll
    • Text diff
    • Text truncation
    • Window events
  • EUI
  • Layout
  • Flex
  • Flex items

Flex items

To work correctly, EuiFlexItem must be a direct child of

EuiFlexGroup or EuiFlexGrid. You cannot have any intermediate HTML wrappers between them.

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.

Flex items are also flex

To allow for continued stretching of nested flex groups/grids and their items, each EuiFlexItem also has the property of

display: flex.

This can sometimes cause unwanted layouts of your content when there are multiple elements, or if the element itself also has some specific display property. To alleviate this, the simplest method is to wrap your inner children with a HTML wrapper like a <div /> or <span />.

Loading...

Alternatively, you can sometimes opt to omit EuiFlexItem completely.

Loading...

Panels grow vertically to fill flex items

The EuiPanel component will naturally grow to fill the EuiFlexItem which contains it.

Loading...

Grow

The grow prop of EuiFlexItem only applies when used within EuiFlexGroup. It is ignored by EuiFlexGrid, which enforces the same width for each item.

Turning off item stretching

By default, all EuiFlexItems will grow horizontally within their flex group if the grow prop is not specified. This can be turned off for each item individually via grow={false}.

Loading...

Proportional widths of items

Alternatively, you can specify a grow number between 1 and 10 for each EuiFlexItem to take up a proportional percentage of the EuiFlexGroup it is in.

Loading...

Props

EuiFlexItem

𐘂𐘂
✄𐘗✄𐘗
Prop
↦
Description and type
↦
Default value
↵
Prop
className#
↦
Description and type
Type: string
↦
Default value
↵
Prop
aria-label#
↦
Description and type
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
grow#
↦
Description and type
Type: boolean | 0 | 5 | 2 | 8 | 3 | 7 | 1 | 4 | 6 | 9 | 10
↦
Default value
true
↵
Prop
component#
↦
Description and type

Customize the component type that is rendered.

It can be any valid React component type like a tag name string
such as 'div' or 'span', a React component (a function, a class,
or an exotic component like memo()).

<EuiFlexItem> accepts and forwards all extra props to the custom
component.
@example // Renders a element

Submit form

Type: ElementType
↦
Default value
'div' as TComponent
↵
Prop
ref#
↦
Description and type
Type: Ref<TComponentRef>
↦
Default value
↵
𐘂𐘂
Edit this page

Previous
Flex groups
Next
Flex grids
  • Flex items are also flex
  • Panels grow vertically to fill flex items
  • Grow
    • Turning off item stretching
    • Proportional widths of items
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic