Skip to main contentSkip to navigation

Positions List

Display current trading positions with P&L tracking.

No open positions

Installation

npx @hanzo/ui@latest add positions-list

Usage

import { PositionsList } from "@hanzo/ui/finance"

export default function Demo() {
  const positions = [
    {
      id: "1",
      symbol: "AAPL",
      side: "buy",
      shares: 100,
      entryPrice: 150.0,
      currentPrice: 175.5,
      pnl: 2550,
      pnlPercent: 17.0,
    },
  ]

  return <PositionsList positions={positions} />
}

Props

PropTypeDefaultDescription
positionsPosition[][]Array of position objects
onClosefunction-Callback when position closed
showPnLbooleantrueShow profit/loss column