yarn add @leafygreen-ui/confirmation-modalname | default | description | type |
|---|---|---|---|
buttonText | '-' | Text rendered in the primary button. Defaults to `"Confirm"` | string |
cancelButtonProps | {} | An object that accepts all Button props except for the `children` prop. The text will always render `cancel` and the `onClick` property will also fire when the `X` button, or backdrop is clicked. | CustomCancelButtonProps |
children* | '-' | Content that will appear inside of the Modal component. | ReactNode |
closeIconColor | 'default' | Determines the color of the close icon. | "default", "dark", "light" |
confirmButtonProps | {} | An object that accepts all Button props except for the `variant` prop. The variant is controlled by the `variant` prop. | CustomConfirmButtonProps |
contentClassName | '-' | className applied to overlay div. Disclaimer: This prop may be deprecated in future versions of Modal | string |
darkMode | false | Renders the component with dark mode styles. | boolean |
data-lgid | '-' | LG test id passed to the component wrapper. | `lg-${string}` |
initialFocus | '-' | By default, when a focus trap is activated the first element in the focus trap's tab order will receive focus. With this option you can specify a different element to receive that initial focus. Selector string (which will be passed to document.querySelector() to find the DOM node) | string |
onCancel | '-' | Callback fired when the cancel button is clicked. | () => void |
onConfirm | '-' | Callback fired when the primary action button is clicked. | () => void |
open | '-' | The component is shown when the value is set to `true`. | boolean |
requiredInputText | '-' | If set, the user will be prompted to type the requiredInputText into an input field | string |
setOpen | () => {} | Callback to change the open state of the Modal. | (open: boolean) => void | Dispatch<SetStateAction<boolean>> |
shouldClose | () => true | Callback to determine whether or not Modal should close when user tries to close it. | () => boolean |
submitDisabled | '-' | If `true`, the primary action button will be disabled | boolean |
title* | '-' | Text of header element | string |
variant | primary | Variant of the modal that represents the type of action handled by the modal. | "primary", "danger" |
...rest | |||