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
      • Guidelines
      • Confirm 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
  • Modal
  • Confirm modal

Confirm modal

Use the EuiConfirmModal to ask the user to confirm a decision. It is a contextual wrapper around EuiModal that provides some helpful props for filling in common modal pieces. By default, the button color indicates a positive or neutral action. Change the

buttonColor property to danger to indicate a destructive action.

Loading...

Loading and disabling confirm button

EuiConfirmModal supports being able to apply loading and disabled states to the confirm button with the confirmButtonDisabled and isLoading props respectively. This is helpful to indicate the fetching of data and/or to wait for a user's input before enabling the confirm action.

Loading...

Props

EuiConfirmModal

Extends HTMLAttributes
𐘂𐘂
✄𐘗✄𐘗
Prop
↦
Description and type
↦
Default value
↵
Prop
onCancel#
↦
Description and type
Type: (event?: any) => void
↦
Default value
Required
↵
Prop
children#
↦
Description and type

ReactNode to render as this component's content

Type: ReactNode
↦
Default value
↵
Prop
title#
↦
Description and type
Type: ReactNode
↦
Default value
↵
Prop
titleProps#
↦
Description and type
Type: Omit<EuiTitleProps, "children"> & HTMLAttributes<HTMLHeadingElement> & { component?: ElementType; }
↦
Default value
↵
Prop
cancelButtonText#
↦
Description and type
Type: ReactNode
↦
Default value
↵
Prop
confirmButtonText#
↦
Description and type
Type: ReactNode
↦
Default value
↵
Prop
onConfirm#
↦
Description and type
Type: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void
↦
Default value
↵
Prop
confirmButtonDisabled#
↦
Description and type
Type: boolean
↦
Default value
↵
Prop
className#
↦
Description and type
Type: string
↦
Default value
↵
Prop
defaultFocusedButton#
↦
Description and type

Allows focusing either the confirm or cancel button on modal initialization.
Will take precedence over initialFocus, if initialFocus is passed.

Type: "cancel" | "confirm"
↦
Default value
↵
Prop
buttonColor#
↦
Description and type
Type: "primary" | "text" | "accent" | "accentSecondary" | "success" | "warning" | "danger"
↦
Default value
primary
↵
Prop
maxWidth#
↦
Description and type

Sets the max-width of the modal.
Set to true to use the default (euiBreakpoints 'm'),
set to false to not restrict the width,
set to a number for a custom width in px,
set to a string for a custom width in custom measurement.

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

Passes isLoading prop to the confirm button

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

Identifies a modal dialog to screen readers. Modal dialogs that confirm destructive actions
or need a user's attention should use "alertdialog".

Type: "dialog" | "alertdialog"
↦
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
initialFocus#
↦
Description and type

Specifies what element should initially have focus.
Can be a DOM node, or a selector string (which will be passed to document.querySelector() to find the DOM node), or a function that returns a DOM node.

Type: string | HTMLElement | (() => HTMLElement)
↦
Default value
↵
𐘂𐘂
Edit this page

Previous
Guidelines
Next
Page components
  • Loading and disabling confirm button
  • Props
EUI is dual-licensed under Elastic License 2.0 and Server Side Public License, v 1 | Crafted with ❤ by Elastic