import { Modal, ModalWrapper } from "@wfp/react"; () => { return ( <ModalWrapper buttonTriggerText="Open modal" modalHeading="Modal heading" modalLabel="Modal label" primaryButtonText="Submit" > Content text </ModalWrapper> ); };
string
ID of the trigger button.
boolean
ReactElement<any,string |JSXElementConstructor<any>>
Specify a custom trigger Button.
Button
ReactNode
Specify the text for the trigger Button.
Specify a class for the trigger Button.
class
() => void
@param handle - function to open the modal
(handle: () => void) => void
@param handle - function to submit content in the modal
@param handle - function to close the modal
ButtonKind
Specify the kind of trigger Button.
Specify whether the Modal should be closed after submit
Specify whether the primary button should be disabled or not
(evt: KeyboardEvent<HTMLDivElement>) => void
A function that is called when the user presses the Esc key to close the modal.
Esc
React.ReactNode
Specify the content of the modal header label.
Specify the content of the modal header title.
Specify whether the modals content should be only loaded when the Modal is open
Modal
open
Specify whether the modal should be button-less
Specify a label to be read by screen readers on the modal root node
HTMLElement
Specify the text for the secondary button
Specify whether the secondary Button should be disabled, or not
Specify a handler for the secondary button. Useful if separate handler from onRequestClose is desirable
onRequestClose
Specify the text for the primary button
Specify whether the Modal is currently open
Specify to hide the close button
string[]
Specify CSS selectors that match DOM elements working as floating menus. Focusing on those elements won't trigger "focus-wrap" behavior
string |boolean
Specify a CSS selector that matches the DOM element that should be focused when the Modal opens. If "false" no selector will be triggered
"info"
Different styling options are available info
info
If true the Modal will be rendered inside a portal at the end of the body element, otherwise at the position it is placed.
If true the Modal will be wider then the regular Modal
(evt: React.UIEvent,trigger: "button" |"key" |"background") => void
Specify a handler for closing modal. The handler should care of closing modal, e.g. changing open prop.
Specify a handler for "submitting" modal. The handler should care of closing modal, e.g. changing open prop, if necessary.
Provide a description for "close" icon that can be read by screen readers
The CSS class name to be placed on the wrapping element.
This optional prop allows you to specify a background image for the component. It expects a string containing a URL address of the image.
(obj?: unknown) => void
This optional prop is a function that handles the onBlur event for the component.
onBlur
React.RefObject<HTMLButtonElement>