Trading

Portfolio

Trading portfolio balance view with Today / All Time stat cards and an expandable 8-column asset table. Fully presentational — pass acategories array of pre-formatted rows.

Preview

Fullscreen

Balance

Trading Portfolio

Value in Rubles
All Time
Today
8 248,37 ₽(0,06%)
All Time
2 193 536,03 ₽(19,56%)
Name
Total
Price
Average
Value
Share
Profit
Profit, %
Currency and Metals1 110,73 ₽0,01%
Funds13 404 600,00 ₽99,99%

Source

Copy this file to components/trading/portfolio.tsx

tsx
'use client'

import * as React from 'react'
import { ChevronDown, ChevronRight, Settings } from 'lucide-react'
import { cn } from '@/lib/utils'

export interface PortfolioAsset {
  symbol: string
  name: string
  quantity: string
  price: string
  avg: string
  value: string
  share: string
  profit: string
  profitPercent: string
  color?: string
}

export interface PortfolioCategory {
  id: string
  name: string
  total: string
  share: string
  items: PortfolioAsset[]
}

export interface PortfolioProps {
  categories: PortfolioCategory[]
  title?: string
  subtitle?: string
  todayChange?: { value: string; percent: string }
  allTimeChange?: { value: string; percent: string }
  className?: string
}

// Balance header with Today / All Time stat cards and an 8-column table of
// expandable categories (click to toggle) with colored asset-row avatars.

Props

PropType
categories*PortfolioCategory[]
titlestring
subtitlestring
todayChange{ value, percent }
allTimeChange{ value, percent }
classNamestring