Position Card
solanaui/position-cardFreeComponent
A card displaying an open trading position with side indicator, token icon, size, leverage, entry/mark prices, and P&L.
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/position-card.jsonSource
1import type React from "react";2import { TokenIcon } from "@/registry/sol/token-icon";3import { Card, CardContent, CardFooter } from "@/components/ui/card";4import { cn } from "@/lib/utils";56interface PositionCardProps extends React.ComponentProps<typeof Card> {7 symbol: string;8 icon: string;9 amount: string;10 value: string;11 apy?: string;12 trend?: "up" | "down";13 children?: React.ReactNode;14}1516const PositionCard = ({17 symbol,18 icon,19 amount,20 value,21 apy,22 trend = "up",23 children,24 className,25 ...props26}: PositionCardProps) => {27 return (28 <Card className={cn("p-4 w-full gap-3", className)} {...props}>29 <CardContent className="flex items-center justify-between p-0 pb-2">30 <div className="flex items-center gap-3">31 <TokenIcon src={icon} alt={symbol} width={48} height={48} />32 <div className="flex flex-col">33 <span className="text-xl font-medium">{symbol}</span>34 {apy && (35 <span36 className={cn(37 "text-xs font-medium",38 trend === "up" ? "text-emerald-500" : "text-red-400",39 )}40 >41 {apy} APY42 </span>43 )}44 </div>45 </div>46 <div className="flex flex-col items-end">47 <span className="text-2xl font-medium">{amount}</span>48 <span className="text-sm text-muted-foreground">{value}</span>49 </div>50 </CardContent>5152 {children && <CardFooter className="p-0">{children}</CardFooter>}53 </Card>54 );55};5657export type { PositionCardProps };58export { PositionCard };
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 |
