nexus-elements-common

📁 availproject/nexus-elements 📅 9 days ago
9
总安装量
4
周安装量
#32156
全站排名
安装命令
npx skills add https://github.com/availproject/nexus-elements --skill nexus-elements-common

Agent 安装分布

claude-code 4
opencode 3
cursor 3
gemini-cli 2
replit 1

Skill 文档

Nexus Elements – Common

Overview

Use the shared hooks/utilities under components/common (polling, debouncing, transaction steps, constants) when building custom Nexus UI.

When to use

  • You want to import usePolling, useStopwatch, useTransactionSteps, or shared constants like SHORT_CHAIN_NAME.
  • You are building a custom component and need the common ErrorBoundary.

Install

There is no standalone @nexus-elements/common registry item. Common files are bundled into most component registries.

Option A: Install any widget that includes common

Install a widget (fast-bridge, transfer, deposit, bridge-deposit, swaps, unified-balance, view-history). It will lay down components/common/* files.

Option B: Manual copy

Copy the files from:

  • registry/nexus-elements/common/* in this repo, or
  • Any https://elements.nexus.availproject.org/r/<component>.json that includes components/common/* in its files list.

Usage

import {
  usePolling,
  useStopwatch,
  useTransactionSteps,
  SHORT_CHAIN_NAME,
} from "@/components/common";

Notes

  • Keep components/common/index.ts intact to preserve exports.
  • useTransactionSteps pairs with NEXUS_EVENTS (STEPS_LIST, STEP_COMPLETE, SWAP_STEP_COMPLETE) for progress UIs.
  • These utilities are internal helpers; prefer using full widgets unless you need custom UI.