npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

tri-test-tanto-widget

v0.0.1-beta.3

Published

Tanto Widget

Downloads

43

Readme

Tanto Widget

Tanto Widget is a React component library designed to provide a seamless Connect Wallet experience for Web3 applications, with a focus on Ronin Wallets and Ethereum-compatible wallets.

Features

  • Unified Ronin Wallet Integration: Connect to Ronin Wallets effortlessly, handling edge cases for desktop, mobile, and in-wallet browsers.
  • Supported Wallets:
    • Ronin Waypoint
    • Ronin Wallet
    • WalletConnect
    • Injected Wallets (EIP-6963 compliant)
  • Responsive Design: Optimized for all screen sizes and devices.
  • Customizable Themes: Tailor the widget’s appearance to match your application’s branding.
  • Powered by Wagmi: Leverages Wagmi’s React hooks for wallet state management, signing, transactions, and blockchain interactions.

Demo

Installation

Prerequisites

Install the required peer dependencies:

yarn add wagmi [email protected] @tanstack/react-query

Install Tanto Widget

yarn add @sky-mavis/tanto-widget

Setup

Wrap your application with the necessary providers (WagmiProvider, QueryClientProvider, and TantoProvider) to enable Tanto Widget functionality.

import { getDefaultConfig, TantoProvider } from '@sky-mavis/tanto-widget';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { WagmiProvider } from 'wagmi';

const config = getDefaultConfig();
const queryClient = new QueryClient();

function App() {
  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <TantoProvider>{/* Your App Components */}</TantoProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
}

export default App;

Usage

TantoConnectButton

Add wallet connection functionality with the TantoConnectButton component.

import { TantoConnectButton } from '@sky-mavis/tanto-widget';

function Page() {
  return <TantoConnectButton />;
}

Behavior:

  • Disconnected: Displays a "Connect Wallet" button that opens a modal for wallet selection.
  • Connected: Shows the wallet’s avatar and address. Clicking it opens a Profile Modal with wallet details and a disconnect option.

Blockchain Interactions

Use Wagmi hooks to interact with the blockchain, such as reading wallet state, signing messages, or sending transactions.

Example: Signing a Message

import { useSignMessage } from 'wagmi';

function SignMessageButton() {
  const { signMessage } = useSignMessage();

  const handleSign = () => {
    signMessage({ message: 'Hello, Web3!' });
  };

  return <button onClick={handleSign}>Sign Message</button>;
}

For more hooks (e.g., useAccount, useSendTransaction), see the Wagmi Documentation.

Customization

Custom Themes

Customize the widget’s appearance by passing a customThemeToken to TantoProvider.

import { TantoProvider } from '@sky-mavis/tanto-widget';
import type { TantoWidgetCustomTheme } from '@sky-mavis/tanto-widget';

const customTheme: TantoWidgetCustomTheme = {
  mode: 'light',
  fontFamily: ["'Nunito'", 'sans-serif'],
  fontSize: '1em',
  buttonPrimaryBackground: 'oklch(0.71 0.097 111.7)',
  buttonPrimaryColor: 'oklch(0.98 0.005 0)',
  modalBackground: 'oklch(0.92 0.042 83.6)',
  modalBorderRadius: '0.625rem',
  // Add more theme tokens as needed
};

function App() {
  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <TantoProvider customThemeToken={customTheme}>
          {/* Your App */}
        </TantoProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
}

See TantoWidgetCustomTheme for a full list of theme tokens.

Custom Wallet Configuration

Customize wallet connection options via getDefaultConfig.

import { getDefaultConfig } from '@sky-mavis/tanto-widget';

const config = getDefaultConfig({
  appName: 'My DApp',
  appIcon: 'https://my-dapp.com/icon.png',
  appDescription: 'A decentralized application for Web3 enthusiasts',
  appUrl: 'https://my-dapp.com',
  walletConnectProjectId: 'YOUR_WALLETCONNECT_PROJECT_ID',
  keylessWalletConfig: {
    chainId: 2020, // Ronin Mainnet
    clientId: 'YOUR_CLIENT_ID',
    waypointOrigin: 'https://waypoint.roninchain.com',
    popupCloseDelay: 1000,
  },
});

Parameters:

  • appName (optional): Name of your DApp (e.g., "My DApp").
  • appIcon (optional): URL to your DApp’s icon (e.g., "https://my-dapp.com/icon.png").
  • appDescription (optional): Brief description of your DApp.
  • appUrl (optional): Your DApp’s URL.
  • walletConnectProjectId (optional): WalletConnect project ID from WalletConnect Cloud.
  • keylessWalletConfig (optional): Configuration for Keyless wallet:
    • chainId (optional): Blockchain chain ID (e.g., 2020 for Ronin Mainnet).
    • clientId: Your client ID for authentication.
    • waypointOrigin (optional): Waypoint service URL (e.g., "https://waypoint.roninchain.com").
    • popupCloseDelay (optional): Delay (ms) before closing the popup (e.g., 1000).

See Wagmi Configuration Docs for advanced options.

TantoProvider Configuration

Customize the widget’s behavior with the config prop.

<TantoProvider
  config={{
    disableProfile: true,
    hideConnectSuccessPrompt: true,
    initialChainId: 2021,
  }}
>
  {/* Your App */}
</TantoProvider>

Options:

  • disableProfile (boolean): Hides wallet address, avatar, and profile modal after connection.
  • hideConnectSuccessPrompt (boolean): Skips the success animation (~1.5s) after connection.
  • initialChainId (number): Target chain ID for the widget (e.g., 2021 for Ronin Testnet).

Custom Connect Button

Create a custom connection button using the render prop pattern.

import { TantoConnectButton } from '@sky-mavis/tanto-widget';

function CustomButton() {
  return (
    <TantoConnectButton>
      {({ isConnected, showModal, address, chainId }) =>
        isConnected ? (
          <p>
            {address} ({chainId})
          </p>
        ) : (
          <button onClick={showModal}>Connect Wallet</button>
        )
      }
    </TantoConnectButton>
  );
}

TantoEmbeddedWidget

Embed the wallet connection UI directly in your page instead of a modal.

import { TantoEmbeddedWidget } from '@sky-mavis/tanto-widget';

function Page() {
  return <TantoEmbeddedWidget />;
}

useTantoModal Hook

Programmatically control the wallet connection modal.

import { useTantoModal } from '@sky-mavis/tanto-widget';

function ModalControl() {
  const { open, show, hide } = useTantoModal();

  return (
    <div>
      <button onClick={show}>Open Modal</button>
      <button onClick={hide}>Close Modal</button>
      <p>Modal is {open ? 'open' : 'closed'}</p>
    </div>
  );
}

Migrating from Ethers.js

If your project currently uses Ethers.js, you can migrate to Viem (the default provider for Wagmi v2) by following the official Wagmi migration guide. This guide covers how to update your hooks and provider setup for compatibility with Wagmi.