Token Icon Group
solanaui/token-icon-groupFreeComponent
Displays a group of overlapping token icons with a configurable max and overflow indicator.
Live preview
live · rendered by the registry
Rendered by solanaui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.solanaui.dev/r/token-icon-group.jsonSource
1import { TokenIcon } from "@/registry/sol/token-icon";2import { cn } from "@/lib/utils";34interface TokenIconGroupProps {5 tokens: { src: string; alt?: string }[];6 size?: number;7 overlap?: number;8 max?: number;9 className?: string;10}1112const TokenIconGroup = ({13 tokens,14 size = 24,15 overlap = -10,16 max = 4,17 className,18}: TokenIconGroupProps) => {19 const visible = tokens.slice(0, max);20 const remaining = tokens.length - max;21 const hasOverlap = visible.length > 1 || remaining > 0;2223 return (24 <div className={cn("flex items-center", className)}>25 {visible.map((token, i) => (26 <div27 key={`${token.src}-${i}`}28 className={cn(29 "rounded-full relative leading-[0]",30 hasOverlap && "ring-2 ring-background",31 )}32 style={{33 marginLeft: i === 0 ? 0 : overlap,34 zIndex: visible.length + 1 - i,35 }}36 >37 <TokenIcon38 src={token.src}39 alt={token.alt ?? "Token"}40 width={size}41 height={size}42 />43 </div>44 ))}45 {remaining > 0 && (46 <div47 className="relative flex items-center justify-center rounded-full bg-muted text-muted-foreground ring-2 ring-background font-medium"48 style={{49 width: size,50 height: size,51 marginLeft: overlap,52 fontSize: size * 0.35,53 zIndex: visible.length + 2,54 }}55 >56 +{remaining}57 </div>58 )}59 </div>60 );61};6263export type { TokenIconGroupProps };64export { TokenIconGroup };
What it pulls in
Other registry items
Files it writes
More from solanaui
All 31 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Action Boxaction-box | solanaui | Components | Free | no deps | |
| Activity Feedactivity-feed | solanaui | Components | Free | 1 dep | |
| Address Displayaddress-display | solanaui | Components | Free | 1 dep | |
| Auth Cardauth-card | solanaui | Components | Free | no deps | |
| Health Barhealth-bar | solanaui | Components | Free | no deps | |
| Leverage Sliderleverage-slider | solanaui | Components | Free | no deps | |
| NFT Cardnft-card | solanaui | Components | Free | no deps | |
| Order Bookorder-book | solanaui | Components | Free | no deps |
