Trend Badge
solanaui/trend-badgeFreeComponent
A badge that displays a percentage change with an up/down arrow icon and color coding.
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/trend-badge.jsonSource
1import { TrendingDownIcon, TrendingUpIcon } from "lucide-react";2import type React from "react";3import { Badge } from "@/components/ui/badge";4import { cn } from "@/lib/utils";56interface TrendBadgeProps extends React.ComponentProps<typeof Badge> {7 trend?: "up" | "down";8}910const TrendBadge = ({11 trend = "up",12 children,13 className,14 ...props15}: TrendBadgeProps) => {16 const isUp = trend === "up";17 const Icon = isUp ? TrendingUpIcon : TrendingDownIcon;1819 return (20 <Badge21 className={cn(22 isUp23 ? "bg-emerald-500/15 text-emerald-500 border-emerald-500/25"24 : "bg-red-400/15 text-red-400 border-red-400/25",25 className,26 )}27 {...props}28 >29 <Icon className="size-3" />30 {children && <span className="text-xs">{children}</span>}31 </Badge>32 );33};3435export type { TrendBadgeProps };36export { TrendBadge };
What it pulls in
npm packages
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 |
