💰
Megapot
  • Overview
    • About Megapot
    • How to play
    • How to provide liquidity
    • How to refer users
    • Earn as a liquidity provider
    • About the Team
    • Megapoints
  • Deep dive
    • Components
    • System Diagram
    • Smart Contract
    • Provably Fair
  • Developers
    • Start Here
    • Add jackpot to your site
      • Custom Integration
        • Getting Started
        • Contract Functions
        • Jackpot Page
        • LP Deposit Page
        • History Page
      • React UI Kit
        • MegapotProvider
        • Jackpot
        • useJackpot
    • Sybil-resistant incentives
    • Launch jackpot in your token
    • Developer Reference
      • Testnet & Mainnet
      • Contract Overview & Functions
      • Megapot API
      • Megapot Examples
      • How to Earn Fees
      • Brand Kit
  • Appendix
    • VIP Program
    • FAQ
    • About Megapot
  • Terms of Service
  • Privacy Policy
  • Responsible Gaming
Powered by GitBook
On this page
  • Usage
  • Props
  • Theming
  • MegapotThemeProps
  1. Developers
  2. Add jackpot to your site
  3. React UI Kit

MegapotProvider

The MegapotProvider is a context provider component that sets up the Megapot UI environment. It provides theming and wallet connection functionalities.

Usage

 <MegapotProvider
    theme={{
      primaryColor: '#693efe',
      theme: 'dark',
    }}
    onConnectWallet={login}
    onSwitchChain={switchChain}
  >
    {children}
  </MegapotProvider>

Props

Name
Type
Description

onConnectWallet*

This function handles the logic for connecting to a wallet, compatible with any wallet provider's connect

onSwitchChain

An optional function that handles chain switching logic, compatible with any wallet provider's connect

theme

An optional theme object to override the default Megapot theme.

Theming

The MegapotProvider allows you to customize the theme by passing a theme prop. This prop should be an object that matches the MegapotThemeProps type. The theme will be deeply merged with the default theme.

MegapotThemeProps

Name
Type
Description

theme

Sets the overall theme of the application. Choose between 'dark' and 'light'.

primaryColor

Defines the primary color used throughout the UI Kit.

fontFamily

Defines the font family used throughout the UI Kit.

text

Customize text colors.

button

Override default button and text button styles.

input

CSS properties to override input styles.

widget

CSS properties to override widget styles.

borderRadius

Defines the border radius for Input and Button components.

PreviousReact UI KitNextJackpot

Last updated 2 months ago

() => void
(chainId: number) => void
MegapotThemeProps
'dark' | 'light'
string
string
{ default?: string; caption?: string; }
{ default?: React.CSSProperties; text?: React.CSSProperties; }
React.CSSProperties
{ style?: React.CSSProperties; }
string