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

@tortoise-os/components

v0.2.0

Published

Reusable UI components for Sui dApps - TortoiseOS

Readme

@tortoise-os/components

Beautiful, reusable UI components for Sui dApps built with Radix UI.

Installation

bun add @tortoise-os/components

Core Components

Address

Display Sui addresses with formatting, copy, and explorer link.

import { Address } from "@tortoise-os/components";

<Address
  address="0xabc123..."
  format="short"       // or "long"
  showCopy={true}
  showExplorer={true}
  label="Wallet"
/>

Balance

Display token balances with auto-refresh.

import { Balance, MultiBalance } from "@tortoise-os/components";

// Single balance
<Balance
  address="0xabc..."
  coinType="0x2::sui::SUI"
  label="SUI Balance"
  watch={true}
/>

// Multiple balances
<MultiBalance
  address="0xabc..."
  coinTypes={[
    { type: "0x2::sui::SUI", label: "SUI" },
    { type: "0xabc::tusd::TUSD", label: "TUSD" },
  ]}
/>

NetworkBadge

Display current network status.

import { NetworkBadge } from "@tortoise-os/components";

<NetworkBadge network="localnet" />
// Colors: localnet=gray, devnet=blue, testnet=orange, mainnet=green

TransactionButton

Button with loading states for transactions.

import { TransactionButton } from "@tortoise-os/components";

<TransactionButton
  onClick={handleSwap}
  isLoading={swap.isLoading}
  isDisabled={!isReady}
  color="green"
  size="3"
>
  Swap Tokens
</TransactionButton>

ObjectDisplay

Display Sui objects with all details.

import { ObjectDisplay } from "@tortoise-os/components";

<ObjectDisplay objectId="0xabc123..." />

DeFi Components

PoolCard

Display AMM pool information.

import { PoolCard } from "@tortoise-os/components";

<PoolCard
  poolId="0xabc..."
  coinASymbol="SUI"
  coinBSymbol="USDC"
/>

Features:

  • Reserve amounts
  • LP supply
  • Fee rate (AI-optimized badge)
  • TVL calculation

VaultCard

Display yield vault information.

import { VaultCard } from "@tortoise-os/components";

<VaultCard
  vaultId="0xabc..."
  name="SUI Vault"
/>

Features:

  • APY display
  • Total deposited
  • Active strategy
  • Utilization rate
  • Last compound timestamp
  • RL-optimized badge

StablecoinCard

Display NFT collateral vault.

import { StablecoinCard } from "@tortoise-os/components";

<StablecoinCard vaultId="0xabc..." />

Features:

  • Collateral value
  • Debt amount
  • NFT count
  • Collateralization ratio with progress bar
  • Health status
  • AI valuation badge

Wallet Components

WalletButton

Enhanced wallet connection button.

import { WalletButton, CustomWalletButton } from "@tortoise-os/components";

// Default dApp Kit button
<WalletButton />

// Custom styled button
<CustomWalletButton
  onConnect={() => console.log("Connected")}
  onDisconnect={() => console.log("Disconnected")}
/>

AccountInfo

Complete account information panel.

import { AccountInfo } from "@tortoise-os/components";

<AccountInfo />

Shows:

  • Address with copy/explorer
  • SUI balance
  • Object count

Utility Components

CopyButton

Copy text to clipboard.

import { CopyButton } from "@tortoise-os/components";

<CopyButton text="0xabc123..." />

ExplorerLink

Link to Sui Explorer.

import { ExplorerLink } from "@tortoise-os/components";

<ExplorerLink address="0xabc..." />
<ExplorerLink objectId="0xdef..." />
<ExplorerLink txDigest="abc123..." network="devnet" />

LoadingSpinner

Loading state indicator.

import { LoadingSpinner } from "@tortoise-os/components";

<LoadingSpinner message="Loading pools..." size="3" />

Styling

All components use Radix UI Themes. Configure your theme:

import { Theme } from "@radix-ui/themes";
import "@radix-ui/themes/styles.css";

<Theme appearance="dark" accentColor="blue">
  <App />
</Theme>

Complete Example

import {
  PoolCard,
  VaultCard,
  WalletButton,
  AccountInfo,
  NetworkBadge,
} from "@tortoise-os/components";
import { Flex, Container } from "@radix-ui/themes";

function Dashboard() {
  return (
    <Container size="4">
      <Flex direction="column" gap="6">
        {/* Header */}
        <Flex justify="between" align="center">
          <NetworkBadge network="localnet" />
          <WalletButton />
        </Flex>

        {/* Account */}
        <AccountInfo />

        {/* Pools */}
        <Flex gap="4" wrap="wrap">
          <PoolCard
            poolId="0x123..."
            coinASymbol="SUI"
            coinBSymbol="USDC"
          />
          <VaultCard
            vaultId="0x456..."
            name="SUI Vault"
          />
        </Flex>
      </Flex>
    </Container>
  );
}

TypeScript

All components are fully typed:

import type {
  AddressProps,
  BalanceProps,
  PoolCardProps,
  VaultCardProps,
} from "@tortoise-os/components";

Customization

Components accept Radix UI props for styling:

<Address
  address="0xabc..."
  style={{ padding: "10px" }}
  className="my-custom-class"
/>

Best Practices

  1. Use watch for real-time data

    <Balance watch={true} />
  2. Provide loading states

    {isLoading ? <LoadingSpinner /> : <PoolCard />}
  3. Handle errors gracefully

    {error ? <ErrorCard error={error} /> : <Component />}
  4. Keep cards responsive

    <Flex gap="4" wrap="wrap">
      {pools.map(pool => <PoolCard key={pool.id} />)}
    </Flex>

License

MIT