For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/components/modal.md.
v0.0.57
  • English
  • Modal

    Feedback@rockshin/tao-ui

    Displays a focused dialog for decisions, forms, and interruptive information.

    When to use

    Use Modal for focused tasks or decisions. Static helpers such as Modal.confirm mirror common confirmation flows.

    Recommended

    • Prefer Modal.useModal inside React trees so dialogs inherit TaoProvider context.
    • Keep modal content short and task-oriented.

    Avoid

    • Do not use nested modals for multi-step workflows.

    Examples

    API

    PropertyDescriptionTypeDefault Value
    footerFooter content. - undefined renders default OK/Cancel buttons - null renders no footer - a function receives (originNode, { OkBtn, CancelBtn }) to compose around the defaultsReactNode | ModalFooterRender-
    okButtonPropsExtra props forwarded to the default OK button.ButtonProps | undefined-
    cancelButtonPropsExtra props forwarded to the default Cancel button.ButtonProps | undefined-
    widthDialog width. Accepts a breakpoint map, e.g. width={{ xs: '100%', md: 640 }} — the largest matching breakpoint wins, falling back to the 520px default when no entry matches.string | number | Partial<Record<TaoBreakpoint, string | number>> | undefined520
    centeredVertically center the dialog. Defaults to true.boolean | undefinedtrue
    closableShow the close (×) button. Defaults to true.boolean | (AriaAttributes & { disabled?: boolean | undefined; closeIcon?: ReactNode; onClose?: (() => void) | undefined; afterClose?: (() => void) | undefined; }) | undefinedtrue
    maskClosableClose when clicking the mask/overlay. Defaults to true.boolean | undefinedtrue
    keyboardClose on Esc key. Defaults to true.boolean | undefinedtrue
    getContainerPortal destination. false renders the dialog in place.string | false | HTMLElement | (() => HTMLElement) | undefined-
    afterCloseCalled after the modal has fully closed (open transitions true → false).(() => void) | undefined-
    destroyOnHiddenUnmount children when closed. Defaults to true. Set false to keep children mounted while releasing modal interaction locks when hidden.boolean | undefinedtrue