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
- js
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.
Param | Type | Default | Remarks |
---|---|---|---|
account | string | - | Supports wallet address or chain agnostic wallet address format |
theme | IWidgetTheme | - | Theme object, it can be custom theme object, lightWidgetTheme darkWidgetTheme |
children | React.ReactNode | - | |
env | Env | - | API env - 'prod' or 'staging' |
signer | SignerType | - | Ethers or Viem Signer |
user | PushAPI | - | initialized Push user for accessing all function calls |
Note: Parameters
in this style
are mandatory.