Modal

Usage

The Modal component can be imported using

import { Modal } from '@tail-kit/tail-kit'

Simple Modal

Large Content Modal

Nested Modal

Alert Modal

Editable Example

Optional Sizes

NameDescriptionDefault Value
title
title of the modal
ReactNode
--
children
content rendered inside the modal
ReactNode
--
closable
Whether a close (x) button is visible on top right of the Modal or not
boolean | undefined
--
onOK
function called on "OK" button click
((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined
--
onCancel
function called on "Cancel" button click
((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined
--
okButtonProps
additional props passed to OK button excluding `onClick`
ActionButtonProps | undefined
--
cancelButtonProps
additional props passed to Cancel button excluding `onClick`
ActionButtonProps | undefined
--
visible
whether modal is visible or not
boolean | undefined
--
onRequestClose
function called when the user is closing the modal, either by clicking on cancel button or overlay
(() => void) | undefined
--
actions
custom actions button instead of OK and Cancel
ReactNode
--
dividers
Show dividers on top and bottom of Modal children
boolean | undefined
--
maxWidth
Change maxWidth of modal using breakpoints
"sm" | "md" | "lg" | "xl" | "2xl" | undefined
sm
portalParent
parent of the portal container
HTMLElement | undefined
typeof window !== 'undefined' ? document.body : undefined