Skip to main content

WidgetUIProvider

Enhance State Management: Boost Your Component's Functionality by Wrapping it with WidgetUIProvider.

You can seamlessly integrate your main root file with the WidgetUIProviderider, allowing you to effortlessly incorporate any component throughout your entire application. This simplifies the process of using components independently across the app, eliminating the need to manage common inputs such as account information and PGP private keys, among others.

Usage

import { WidgetUIProvider } from "@pushprotocol/uiweb";
import { darkWidgetTheme } from "@pushprotocol/uiweb";

export function App({ Component }) {
return (
<WidgetUIProvider theme={darkWidgetTheme}>
<Component />
</WidgetUIProvider>
);
}

Customization parameters

Customize the parameters as per your need and the widget component being used.

ParamTypeDefaultRemarks
accountstring-Supports wallet address or chain agnostic wallet address format
themeIWidgetTheme-Theme object, it can be custom theme object, lightWidgetTheme darkWidgetTheme
childrenReact.ReactNode-
envEnv-API env - 'prod' or 'staging'
signerSignerType-Ethers or Viem Signer
userPushAPI-initialized Push user for accessing all function calls

Note: Parameters in this style are mandatory.