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
      • Utilities
    • 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
  • Theming
  • Breakpoints
  • Utilities

Breakpoint utilities

Screen sizes

The sizing options correlate with the keys in

euiTheme.breakpoint. The named breakpoint starts at the pixel value provided and ends before the next one.

โœ„๐˜—
tsx code block:
โœ„๐˜—'xl': 1200, // and up 'l': 992, // to 1199 'm': 768, // to 991 's': 575, // to 767 'xs': 0, // to 574

Show for

The EuiShowFor wrapping utility component will not render its children unless the window width matches the range of one of the named breakpoints provided to the sizes prop.

Loading...

Hide for

The EuiHideFor wrapping utility component will not render its children while the window width matches the range of one of the named breakpoints provided to the sizes prop.

Loading...

Responsive classes

Similar to the wrapping components, these classes will hide or show the element based on the current current width matching the range of the declared size. However, they simply utilize the display property which means they will still render in the DOM.

.eui-showFor--[size] className

Shows the element only for the specified breakpoint by applying display: none; for all, then applying display: inline; when within the breakpoint size. The element will still render and exist in the DOM.

.eui-showFor--xs
.eui-showFor--s
.eui-showFor--m
.eui-showFor--l
.eui-showFor--xl
โœ„๐˜—
tsx code block:
โœ„๐˜—<span className="eui-showFor--xs"> {/* Your content */} </span>

.eui-showFor--[size]--[display] className

The eui-showFor--[size] classes will force display of inline when showing the element. You can modify this display property by appending one of the following display properties block, inlineBlock, or flex.

spanspanspan
โœ„๐˜—
tsx code block:
โœ„๐˜—<span className="eui-showFor--xs--flex"> {/* Your content */} </span>

.eui-hideFor--[size] className

Hides the element for the specified breakpoint size with display: none;. The element will still render and exist in the DOM.

.eui-hideFor--xs
.eui-hideFor--s
.eui-hideFor--m
.eui-hideFor--l
.eui-hideFor--xl
โœ„๐˜—
tsx code block:
โœ„๐˜—<span className="eui-hideFor--xs"> {/* Your content */} </span>

Props

EuiShowFor

๐˜‚๐˜‚
โœ„๐˜—โœ„๐˜—
Prop
โ†ฆ
Description and type
โ†ฆ
Default value
โ†ต
Prop
children#
โ†ฆ
Description and type

Required otherwise nothing ever gets returned

Type: ReactNode
โ†ฆ
Default value
Required
โ†ต
Prop
sizes#
โ†ฆ
Description and type

List of all the responsive sizes to show the children for.
Array of #EuiBreakpointSize

Type: string[] | "none" | "all"
โ†ฆ
Default value
Required
โ†ต
๐˜‚๐˜‚

EuiHideFor

๐˜‚๐˜‚
โœ„๐˜—โœ„๐˜—
Prop
โ†ฆ
Description and type
โ†ฆ
Default value
โ†ต
Prop
children#
โ†ฆ
Description and type

Required otherwise nothing ever gets returned

Type: ReactNode
โ†ฆ
Default value
Required
โ†ต
Prop
sizes#
โ†ฆ
Description and type

List of all the responsive sizes to hide the children for.
Array of #EuiBreakpointSize

Type: string[] | "none" | "all"
โ†ฆ
Default value
Required
โ†ต
๐˜‚๐˜‚
Edit this page

Previous
Breakpoints
Next
Colors
  • Screen sizes
  • Show for
  • Hide for
  • Responsive classes
    • .eui-showFor--[size] className
    • .eui-showFor--[size]--[display] className
    • .eui-hideFor--[size] className
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with โค by Elastic