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
    • 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
  • Header

Header

The header is made up of many individual components starting with EuiHeader as the container. You can manually configure your header with the following related components:

  • EuiHeaderSection: Left/right containers with flex properties.
  • EuiHeaderSectionItem: Containers for individual header items as flex items.
  • EuiHeaderSectionItemButton: Specialized button that extends EuiButtonEmpty but styled to fit the height of the header with additional notification props.
  • EuiHeaderLogo: A helpful component for creating a linked logo that fits within the header sizing.
  • EuiHeaderBreadcrumbs: A set of EuiBreadcrumbs specifically stylized to fit inside the header.
Loading...

Sections

Alternatively, you can pass an array of objects to the sections prop that takes a key of items (array of children to wrap in an EuiHeaderSectionItem) and/or breadcrumbs (array of breadcrumb objects). Each item in the array will be wrapped in an EuiHeaderSection.

Note: Passing sections and children will disregard the children as it is not easily interpreted at what location the children should be placed.

Loading...

Header links

In addition to the components mentioned prior, which lend themselves to more application style navigation patterns, EuiHeaderLinks and EuiHeaderLink supply the ability to inline a list of navigational or menu style links.

EuiHeaderLinks comes with responsive functionality built-in which will convert the inline list of links to a popover list triggered by a EuiHeaderSectionItemButton. You can adjust at which breakpoints to switch to the popover display by passing your own array of named breakpoints to popoverBreakpoints.

Loading...

Fixed header

Most consumers need a header that does not scroll away with the page contents. You can set this display by applying the property position="fixed". Multiple fixed headers will automatically stack underneath one another. No manual positioning is required.

If you're using EuiPageTemplate, a padding top will be automatically set based on the number of fixed headers on the page. EuiFlyouts will also automatically account for and sit below fixed headers.

If you're using your own custom layout, or have custom UI that needs to sit below your fixed header(s), EUI provides a global CSS var(--euiFixedHeadersOffset) variable. You can use this variable anywhere, or even override it, to correctly offset any and all fixed header heights.

Loading...

Dark theme

To make site-wide navigation more prominent, EuiHeader supports reversing the colors to dark theme with theme="dark". However, it only supports a limited set of children that will also shift their theme. These components include EuiHeaderLogo, EuiHeaderLink(s), EuiHeaderSectionItemButton and EuiSelectableTemplateSitewide. Any other content may not render correctly without custom configurations.

Loading...

Portal content in the header

Use an EuiHeaderSectionItemButton to display additional information in popovers or flyouts, such as a user profile or news feed. When using EuiFlyout, be sure to wrap it in a EuiPortal. When using an EuiPopover in conjunction with a fixed header, be sure to add the repositionOnScroll prop to the popover.

The example below shows how to incorporate EuiHeaderAlert components to show a list of updates inside a EuiFlyout and a EuiPopover .

Loading...

Header notifications

To alert or notify users about the additional information they are receiving, use the EuiHeaderSectionItemButton notification prop. You can pass a node that will render inside a EuiBadgeNotification or pass true to render a simple dot. You can also animate the button by calling the euiAnimate() method on the EuiHeaderSectionItemButton ref.

Loading...

Stacked headers

Stacking multiple headers provides a great way to separate global navigation concerns.

Loading...

The Elastic navigation pattern

Putting it all together

The button below will launch a fullscreen example that includes two EuiHeaders with all the appropriate navigation pieces including EuiCollapsibleNav, EuiHeaderAlerts, user menu, deployment switcher, space selector, EuiHeaderBreadcrumbs and EuiHeaderLinks for app menu items.

This is just a pattern and should be treated as such. Consuming applications will need to recreate the pattern according to their context and save the states as is appropriate to their data store.

Loading...

Props

EuiHeader

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
sections#
↦
Description and type

An array of objects to wrap in a #EuiHeaderSection.
Each section is spaced using space-between.
See #EuiHeaderSectionsProp for object details.
This prop disregards the prop children if both are passed.

Type: EuiHeaderSections[]
↦
Default value
↵
Prop
position#
↦
Description and type

Helper that positions the header against the window body and
adds the correct amount of top padding to the window when in fixed mode

Type: "fixed" | "static"
↦
Default value
static
↵
Prop
theme#
↦
Description and type

The default will inherit its coloring from the light or dark theme.
Or, force the header into pseudo dark theme for all themes.

Type: "dark" | "default"
↦
Default value
default
↵
𐘂𐘂

EuiHeaderSection

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
side#
↦
Description and type
Type: "left" | "right"
↦
Default value
↵
Prop
grow#
↦
Description and type
Type: boolean
↦
Default value
false
↵
𐘂𐘂

EuiHeaderSectionItem

𐘂𐘂
✄𐘗✄𐘗
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
children#
↦
Description and type

ReactNode to render as this component's content

Type: ReactNode
↦
Default value
↵
𐘂𐘂

EuiHeaderSectionItemButton

Extends AnchorHTMLAttributes, ButtonHTMLAttributes
𐘂𐘂
✄𐘗✄𐘗
Prop
↦
Description and type
↦
Default value
↵
Prop
color#
↦
Description and type

Any of the named color palette options.

Type: "primary" | "text" | "accent" | "accentSecondary" | "success" | "warning" | "danger"
↦
Default value
↵
Prop
size#
↦
Description and type
Type: "xs" | "s" | "m"
↦
Default value
↵
Prop
flush#
↦
Description and type

Ensure the text of the button sits flush to the left, right, or both sides of its container

Type: "left" | "right" | "both"
↦
Default value
↵
Prop
isDisabled#
↦
Description and type

disabled is also allowed

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

Force disables the button and changes the icon to a loading spinner

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

Applies the boolean state as the aria-pressed property to create a toggle button.
Only use when the readable text does not change between states.

Type: boolean
↦
Default value
↵
Prop
href#
↦
Description and type
Type: string
↦
Default value
↵
Prop
target#
↦
Description and type
Type: string
↦
Default value
↵
Prop
rel#
↦
Description and type
Type: string
↦
Default value
↵
Prop
type#
↦
Description and type
Type: "button" | "reset" | "submit"
↦
Default value
↵
Prop
buttonRef#
↦
Description and type
Type: Ref<HTMLAnchorElement | HTMLButtonElement>
↦
Default value
↵
Prop
contentProps#
↦
Description and type

Object of props passed to the <span> wrapping the button's content

Type: CommonProps & EuiButtonDisplayContentType
↦
Default value
↵
Prop
iconType#
↦
Description and type

Any type accepted by EuiIcon

Type: IconType
↦
Default value
↵
Prop
iconSide#
↦
Description and type

Can only be one side left or right

Type: ButtonContentIconSide
↦
Default value
↵
Prop
textProps#
↦
Description and type

Object of props passed to the <span> wrapping the content's text/children only (not icon)

This span wrapper can be removed by passing textProps={false}.

Type: false | (HTMLAttributes<HTMLSpanElement> & CommonProps & { ref?: Ref<HTMLSpanElement>; 'data-text'?: string; })
↦
Default value
↵
Prop
iconSize#
↦
Description and type
Type: "s" | "m"
↦
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
onClick#
↦
Description and type
Type: MouseEventHandler<HTMLAnchorElement> | MouseEventHandler<HTMLButtonElement>
↦
Default value
↵
Prop
notification#
↦
Description and type

Inserts the node into a EuiBadgeNotification and places it appropriately against the button.
Or pass true to render a simple dot

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

Changes the color of the notification background

Type: "accent" | "success" | "subdued"
↦
Default value
accent
↵
Prop
ref#
↦
Description and type

Allows getting a ref to the component instance.
Once the component unmounts, React will set ref.current to null
(or call the ref with null if you passed a callback ref).
@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}

Type: LegacyRef<HTMLButtonElement & { euiAnimate: () => void; }>
↦
Default value
↵
𐘂𐘂

EuiHeaderLogo

Extends AnchorHTMLAttributes
𐘂𐘂
✄𐘗✄𐘗
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
iconType#
↦
Description and type
Type: IconType
↦
Default value
logoElastic
↵
Prop
iconTitle#
↦
Description and type
Type: string
↦
Default value
Elastic
↵
𐘂𐘂

EuiHeaderBreadcrumbs

𐘂𐘂
✄𐘗✄𐘗
Prop
↦
Description and type
↦
Default value
↵
Prop
breadcrumbs#
↦
Description and type

The array of individual #EuiBreadcrumb items

Type: EuiBreadcrumbProps[]
↦
Default value
Required
↵
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
responsive#
↦
Description and type

Hides extra (above the max) breadcrumbs under a collapsed item as the window gets smaller.
Pass a custom #EuiBreadcrumbResponsiveMaxCount object to change the number of breadcrumbs to show at the particular breakpoints.

Pass false to turn this behavior off.

Default: { xs: 1, s: 2, m: 4 }

Type: boolean | EuiBreadcrumbResponsiveMaxCount
↦
Default value
↵
Prop
truncate#
↦
Description and type

Forces all breadcrumbs to single line and
truncates each breadcrumb to a particular width,
except for the last item

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

Collapses the inner items past the maximum set here
into a single ellipses item.
Omitting or passing a 0 value will show all breadcrumbs.

Type: number
↦
Default value
↵
Prop
type#
↦
Description and type

Determines breadcrumbs appearance, with page being the default styling.
Application breadcrumbs should only be once per page, in (e.g.) EuiHeader

Type: "page" | "application"
↦
Default value
↵
Prop
lastBreadcrumbIsCurrentPage#
↦
Description and type

Whether the last breadcrumb should be semantically highlighted as the
current page. (improves accessibility for screen readers users)
Defaults to true.

Type: boolean
↦
Default value
↵
𐘂𐘂
Edit this page

Previous
Resizable flyouts
Next
Horizontal rule
  • Sections
  • Header links
  • Fixed header
  • Dark theme
  • Portal content in the header
  • Header notifications
  • Stacked headers
  • The Elastic navigation pattern
    • Putting it all together
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic