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
      • Guidelines
    • 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
  • Navigation
  • Tabs

Tabs

Use tabs to organize related but unique content for a single idea or subject. Tabs show and hide content using in-page navigation UI.

EuiTabs is a wrapping component that requires EuiTab components as direct children. You control the displayed contents and current state through props on EuiTab like

isSelected and onClick.

Use the prepend and append tab props to add content before and after the tab label respectively.

Loading...

Tab sizes

EuiTabs allow a size prop. In general you should always use the default (medium) size. The small size is best for when placing inside popovers or other small containers. Reserve using the large size for when using as primary page navigation, like inside of

EuiPageHeader.

You can also use the expand prop to evenly stretch each tab horizontally.

Loading...

Bottom border

The bottomBorder helps to separate the tab group from the content below and is on by default. However, some components like flyouts already provide borders which can act as the divider. In this case you can turn the border off with bottomBorder={false}.

Loading...

Tabbed content

EuiTabbedContent makes it easier to associate tabs with content based on the selected tab. Use the initialSelectedTab prop to specify which tab to initially select.

Loading...

Controlled tabbed content

You can also use the selectedTab and onTabClick props to take complete control over tab selection. This can be useful if you want to change tabs based on user interaction with another part of the UI.

Loading...

Props

EuiTabs

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

ReactNode to render as this component's content

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

Evenly stretches each tab to fill the
horizontal space

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

Adds a bottom border to separate it from the content after

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

Sizes affect both font size and overall size.
Only use the xl size when displayed as page titles.

Type: "s" | "m" | "l" | "xl"
↦
Default value
m
↵
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<HTMLDivElement>
↦
Default value
↵
𐘂𐘂

EuiTab

Extends AnchorHTMLAttributes, ButtonHTMLAttributes
𐘂𐘂
✄𐘗✄𐘗
Prop
↦
Description and type
↦
Default value
↵
Prop
href#
↦
Description and type
Type: string
↦
Default value
↵
Prop
isSelected#
↦
Description and type
Type: boolean
↦
Default value
↵
Prop
disabled#
↦
Description and type
Type: boolean
↦
Default value
↵
Prop
prepend#
↦
Description and type

Places content before the tab content/children.
Will be excluded from interactive effects.

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

Places content after the tab content/children.
Will be excluded from interactive effects.

Type: ReactNode
↦
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
↵
𐘂𐘂

EuiTabbedContent

Extends HTMLAttributes
𐘂𐘂
✄𐘗✄𐘗
Prop
↦
Description and type
↦
Default value
↵
Prop
tabs#
↦
Description and type

Each tab needs id and content properties, so we can associate it with its panel for accessibility.
The name property (a node) is also required to display to the user.

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

When tabbing into the tabs, set the focus on initial for the first tab,
or selected for the currently selected tab. Best use case is for inside of
overlay content like popovers or flyouts.

Type: "initial" | "selected"
↦
Default value
initial
↵
Prop
expand#
↦
Description and type

Evenly stretches each tab to fill the horizontal space

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

Use this prop to set the initially selected tab while letting the tabbed content component
control selection state internally

Type: EuiTabbedContentTab
↦
Default value
↵
Prop
onTabClick#
↦
Description and type
Type: (selectedTab: EuiTabbedContentTab) => void
↦
Default value
↵
Prop
selectedTab#
↦
Description and type

Use this prop if you want to control selection state within the owner component

Type: EuiTabbedContentTab
↦
Default value
↵
Prop
size#
↦
Description and type
Type: "s" | "m" | "l" | "xl"
↦
Default value
↵
𐘂𐘂
Edit this page

Previous
Horizontal steps
Next
Guidelines
  • Tab sizes
  • Bottom border
  • Tabbed content
  • Controlled tabbed content
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic