Nexus Widget
avail-widgets/nexusFreeComponent
The unified Avail Nexus widget for swap, send, and deposit flows. One component for all cross-chain operations powered by Nexus intents.
Install it
npx shadcn@latest add https://elements.nexus.availproject.org/r/nexus.jsonSource
1// biome-ignore-all lint: NexusWidget registry component from shadcn registry.23import React from "react";45const identiconPalette = [6 "var(--foreground-brand)",7 "#16A34A",8 "#B7791F",9 "#7C3AED",10 "#DB2777",11 "#0891B2",12 "#EA580C",13 "#475569",14];1516const hashAddress = (address: string) => {17 let hash = 0;18 for (const char of address.toLowerCase()) {19 hash = (hash << 5) - hash + char.charCodeAt(0);20 hash |= 0;21 }22 return Math.abs(hash);23};2425export function AddressIdenticon({26 address,27 size = 18,28}: {29 address: string;30 size?: number;31}) {32 const hash = hashAddress(address);33 const primary = identiconPalette[hash % identiconPalette.length];34 const secondary =35 identiconPalette[Math.floor(hash / 7) % identiconPalette.length];36 const accent =37 identiconPalette[Math.floor(hash / 13) % identiconPalette.length];38 const rotation = hash % 360;3940 return (41 <span42 aria-hidden="true"43 style={{44 background: `conic-gradient(from ${rotation}deg, ${primary}, ${secondary}, ${accent}, ${primary})`,45 border: "1px solid #FFFFFE",46 borderRadius: "999px",47 boxShadow: "0 0 0 1px #E8E8E7",48 boxSizing: "border-box",49 display: "inline-block",50 flexShrink: 0,51 height: size,52 width: size,53 }}54 />55 );56}
What it pulls in
npm packages
Other registry items
Files it writes
More from avail-widgets
All 27 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | avail-widgets | Components | Free | 2 deps | |
| All Elementsall | avail-widgets | Components | Free | no deps | |
| Animated Spinneranimated-spinner | avail-widgets | Components | Free | no deps | |
| Badgebadge | avail-widgets | Components | Free | 2 deps | |
| Bridge Depositbridge-deposit | avail-widgets | Components | Free | 3 deps · 32 files | |
| Buttonbutton | avail-widgets | Components | Free | 2 deps | |
| Cardcard | avail-widgets | Components | Free | no deps | |
| Checkboxcheckbox | avail-widgets | Components | Free | 2 deps |
