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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@avon_xyz/widget

v0.2.3

Published

Embeddable Avon widget.

Readme

Avon Widget

The @avon_xyz/widget package exposes the MegaVaultPositionWidget, a drop-in React component that lets your users deposit to and withdraw from the Avon MegaVault without leaving your app. The widget consumes wagmi and React Query providers and accepts optional theme overrides so it can match any host interface.

Installation

pnpm i @avon_xyz/widget
# or
npm install @avon_xyz/widget
# or
yarn add @avon_xyz/widget

After installing, ensure your application wraps its tree with:

  • WidgetThemeProvider (optional but required if you want to access the theme context)
  • WagmiConfig using the exported wagmi client
  • QueryClientProvider for React Query

Import the prebuilt widget styles once (for example in your global stylesheet or _app.tsx):

import "@avon_xyz/widget/styles.css";

Usage

Import the widget from the package and render it wherever you want the vault controls to appear:

import { MegaVaultPositionWidget } from "@avon_xyz/widget";

export default function Example() {
  return (
    <MegaVaultPositionWidget
      chainId={4326 | 6343}
      referrerAddress="0x..."
      appName="YOUR_APP_NAME"
      widgetBackground="#050a1f"
      borderColor="#1e2645"
      textPrimary="#f4f7ff"
      textSecondary="rgba(244, 247, 255, 0.75)"
      accent="#ffb347"
      accentSecondary="#ffcc33"
      tabActiveBackground="#ffb347"
      tabActiveText="#050a1f"
      inputCardBackground="#0b1733"
      actionButtonBackground="#ffb347"
      actionButtonText="#050a1f"
      secondaryButtonBackground="rgba(255, 255, 255, 0.1)"
      secondaryButtonText="#f4f7ff"
      sliderTrackBackground="#0b1733"
      sliderThumbBackground="#ffb347"
      sliderTooltipBackground="#ffb347"
      sliderTooltipText="#050a1f"
      primaryFontClass=""
      secondaryFontClass="font-supply-mono"
      success="#56f1c2"
      error="#ff6b81"
      pending="#ffe066"
      shadow="0 25px 60px rgba(5, 10, 31, 0.55)"
      borderRadius="12px"
    />
  );
}

All props are optional—omitting them falls back to the defaults provided by useWidgetTheme(). The configuration above mirrors the playground under src/pages/index.tsx, so you can copy it to replicate the showcased style or trim it down to the few overrides you need.

Handling wallet connections

If you want the widget to trigger your app's wallet flow, pass an onConnectWallet callback. The widget invokes this callback whenever a user presses the primary action while disconnected, letting you wire it to whichever onboarding system you prefer.

Privy example

import { usePrivy } from "@privy-io/react-auth";
import { MegaVaultPositionWidget } from "@avon_xyz/widget";

export default function PrivyExample() {
  const { login, authenticated, connectWallet } = usePrivy();
  return (
    <MegaVaultPositionWidget
      //  ...YOUR CONFIG HERE...
      onConnectWallet={() => {
        if (authenticated) {
          connectWallet();
        } else {
          login();
        }
      }}
    />
  );
}

RainbowKit example

import { useConnectModal } from "@rainbow-me/rainbowkit";
import { MegaVaultPositionWidget } from "@avon_xyz/widget";

export default function RainbowKitExample() {
  const { openConnectModal } = useConnectModal();

  return (
    <MegaVaultPositionWidget
      //  ...YOUR CONFIG HERE...
      onConnectWallet={() => {
        if (openConnectModal) {
          openConnectModal();
        }
      }}
    />
  );
}