> ## Documentation Index
> Fetch the complete documentation index at: https://dynamic-docs-feat-sidebar-revamp.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# useDynamicModals

### Summary

This hook can be used to programmatically show/hide some dynamic modals.
The hook needs to be initialized within a child of [DynamicContextProvider](/react-sdk/providers/dynamiccontextprovider).

### Usage

Available functions and states:

| Method                    | Type                       | Description                                            |
| ------------------------- | :------------------------- | :----------------------------------------------------- |
| setShowLinkNewWalletModal | `Dispatch<SetStateAction>` | Use it to link a new wallet when the user is logged in |

### Example

```TypeScript
const LinkNewWalletButton = () => {
  const { setShowLinkNewWalletModal } = useDynamicModals();
  return (
    <button
      onClick={() => setShowLinkNewWalletModal(true)}
    >
      Link a new wallet
    </button>
  );
};
```
