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
PassdefaultAuthIdentifier 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
- The modal component (
<ParaModal />) must be rendered within theParaProviderfor this hook to work - 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