interface ModalContentProps {
    actions?: any;
    aria-describedby?: string;
    aria-label?: string;
    aria-labelledby?: string;
    backdropId?: string;
    bodyAriaLabel?: string;
    bodyAriaRole?: string;
    boxId: string;
    children: ReactNode;
    className?: string;
    description?: ReactNode;
    descriptorId: string;
    disableFocusTrap?: boolean;
    elementToFocus?: string | HTMLElement | SVGElement;
    footer?: ReactNode;
    hasNoBodyWrapper?: boolean;
    header?: ReactNode;
    help?: ReactNode;
    isOpen?: boolean;
    labelId: string;
    maxWidth?: string | number;
    onClose?: ((event: KeyboardEvent | MouseEvent<Element, MouseEvent>) => void);
    ouiaId?: string | number;
    ouiaSafe?: boolean;
    position?: "default" | "top";
    positionOffset?: string;
    showClose?: boolean;
    title?: ReactNode;
    titleIconVariant?:
        | ComponentType<any>
        | "success"
        | "danger"
        | "warning"
        | "info"
        | "custom";
    titleLabel?: string;
    variant?:
        | "small"
        | "default"
        | "medium"
        | "large";
    width?: string | number;
}

Hierarchy (view full)

Properties

actions?: any

Action buttons to add to the standard modal footer. Ignored if the footer property is passed in.

aria-describedby?: string

Id to use for the modal box descriptor.

aria-label?: string

Accessible descriptor of the modal.

aria-labelledby?: string

Id to use for the modal box label.

backdropId?: string

Id of the backdrop.

bodyAriaLabel?: string

Accessible label applied to the modal box body. This should be used to communicate important information about the modal box body div element if needed, such as that it is scrollable.

bodyAriaRole?: string

Accessible role applied to the modal box body. This will default to "region" if the bodyAriaLabel property is passed in. Set to a more appropriate role as applicable based on the modal content and context.

boxId: string

Id of the modal box container.

children: ReactNode

Content rendered inside the modal.

className?: string

Additional classes added to the modal box.

description?: ReactNode

Description of the modal.

descriptorId: string

Id of the modal box description.

disableFocusTrap?: boolean

Flag to disable focus trap.

elementToFocus?: string | HTMLElement | SVGElement

The element to focus when the modal opens. By default the first focusable element will receive focus.

footer?: ReactNode

Custom footer.

hasNoBodyWrapper?: boolean

Flag indicating if modal content should be placed in a modal box body wrapper.

header?: ReactNode

Complex header (more than just text), supersedes the title property for header content.

help?: ReactNode

Optional help section for the modal header.

isOpen?: boolean

Flag to show the modal.

labelId: string

Id of the modal box title.

maxWidth?: string | number

Maximum width of the modal.

onClose?: ((event: KeyboardEvent | MouseEvent<Element, MouseEvent>) => void)

A callback for when the close button is clicked.

ouiaId?: string | number

Value to overwrite the randomly generated data-ouia-component-id.

ouiaSafe?: boolean

Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false.

position?: "default" | "top"

Position of the modal. By default a modal will be positioned vertically and horizontally centered.

positionOffset?: string

Offset from alternate position. Can be any valid CSS length/percentage.

showClose?: boolean

Flag to show the close button in the header area of the modal.

title?: ReactNode

Text content of the modal header.

titleIconVariant?:
    | ComponentType<any>
    | "success"
    | "danger"
    | "warning"
    | "info"
    | "custom"

Optional alert icon (or other) to show before the title of the modal header. When the predefined alert types are used the default styling will be automatically applied.

titleLabel?: string

Optional title label text for screen readers.

variant?:
    | "small"
    | "default"
    | "medium"
    | "large"

Variant of the modal.

width?: string | number

Default width of the modal.