Skip to main content
The useModal hook provides methods to control the Para modal’s visibility. This is useful for programmatically opening the modal for authentication or wallet management.

Import

Usage

Parameters

This hook does not accept any parameters.

Return Type

Example: Conditional Modal Control

Example: Dynamic Auth Identifier

Pass defaultAuthIdentifier directly to openModal to pre-populate the auth input at the moment the modal opens, without needing to set it at the provider level.

Example: Auto-open on Mount

Notes

  • ParaProvider renders the modal by default, so useModal can open and close that embedded modal
  • If you render your own <ParaModal />, set config={{ disableEmbeddedModal: true }} on ParaProvider to avoid two modal instances
  • Opening the modal when a user is not connected will show the authentication flow
  • Opening the modal when a user is connected will show wallet management options
  • The modal can be closed by the user clicking outside or using the close button