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
      • Guidelines
    • 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
  • Display
  • Empty prompt

Empty prompt

The EuiEmptyPrompt is the building block to create an empty state. You can use it as a placeholder for any type of empty content. They are especially helpful for replacing entire pages or parts of a product that contain no content.

Be sure to read the full

empty prompt usage guidelines.

While no one piece of content is required, each EuiEmptyPrompt should contain at least a

title (wrapped in an HTML heading element) and/or a description. They usually contain one or more actions that promotes the primary call-to-actions. You can also provide a footer to direct users towards making informed decisions.

Loading...

Less content, more actions

You can remove parts of the prompt to simplify it. You can also provide an array of multiple actions. Be sure to list primary actions first and secondary actions as empty buttons.

Loading...

Panel options

The EuiEmptyPrompt is wrapped by EuiPanel. By default, the panel is set to transparent but you can customize other panel options like color, hasBorder and paddingSize. Changing the color prop will also attempt to adjust the iconColor and footer color.

Read the usage guidelines to better understand when to use certain panel props.

Loading...

Title sizes and icon colors

Other customization options include changing thetitleSize to any of the EuiTitle sizes and iconColor. When using an application or solution logo as the iconType, you can reset to the multi-tone colors with iconColor="default"

Loading...

Loading and error prompts

Empty prompts can also be used to emulate loading and error states, by utilizing the same patterns.

For loading states, instead of passing a iconType, you can provide a custom icon and pass in one of our loading components.

Loading...

For error states, you can simply set the color to danger.

Loading...

Layout

You can supply a layout of either "horizontal" or "vertical" with the default being vertical. When creating empty states we want the content to be short and straight to the point. So most of the time, the vertical layout is enough. All the content will be center aligned and this type of text alignment only works with small content.

When you have longer body text with multiple calls to action, you can use the horizontal layout. This layout works best when you can provide a larger graphic like an illustration as the icon. For consistency, we recommend providing the illustration using a EuiImage with size="fullWidth".

Loading...

More types of empty states

EuiEmptyPrompt can be used for more than just empty pages. The following example showcases different types of empty states that you can create with the EuiEmptyPrompt. For a full list see the usage guidelines.

Loading...

Using in a page template

When using a EuiEmptyPrompt in a EuiPageTemplate, we recommend using the namespaced component so the template can determine which how to display the empty prompt based on the rest of the template configuration.

The following example shows the usage of the EuiPageTemplate.EmptyPrompt namespaced component.

Loading...

You can then tie multiple types of empty states together to create a seamless loading to empty or loading to error experience. The following example shows how to incorporate these states with EuiPageTemplate.EmptyPrompt.

Loading...

Props

EuiEmptyPrompt

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

Background color of the panel;
Usually a lightened form of the brand colors

Type: PanelColor
↦
Default value
transparent
↵
Prop
hasBorder#
↦
Description and type

Adds a slight 1px border on all edges.
Only works when color="plain | transparent"

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

Adds a medium shadow to the panel;
Only works when color="plain"

Type: boolean
↦
Default value
↵
Prop
iconType#
↦
Description and type
Type: IconType
↦
Default value
↵
Prop
iconColor#
↦
Description and type

Color for iconType when passed as an IconType

Type: string
↦
Default value
↵
Prop
icon#
↦
Description and type

Custom icon replacing the one generated by iconType

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

Requires passing a single element that gets wrapped in an EuiTitle.
Recommendation is a heading, preferrably an <h2> if in its own section

Type: ReactElement
↦
Default value
↵
Prop
titleSize#
↦
Description and type

Choose from one of the EuiTitle.size options

Type: "xs" | "s" | "m" | "l" | "xxxs" | "xxs"
↦
Default value
m
↵
Prop
body#
↦
Description and type

Gets wrapped in a subdued EuiText block.
Recommendation is to pass typical text elements like <p>

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

Pass a single or an array of actions (buttons) that get stacked at the bottom.
Recommendation is to pass the primary action first and secondary actions as empty buttons

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

Optionally provide a footer. Accepts any combination of elements.

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

Sets the layout. When horizontal the icon goes to the right column.

Type: "horizontal" | "vertical"
↦
Default value
vertical
↵
Prop
paddingSize#
↦
Description and type

Padding applied around the content and footer.

Type: "s" | "m" | "l" | "none"
↦
Default value
l
↵
𐘂𐘂
Edit this page

Previous
Drag and drop
Next
Guidelines
  • Less content, more actions
  • Panel options
  • Title sizes and icon colors
  • Loading and error prompts
  • Layout
  • More types of empty states
  • Using in a page template
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic