Earnings

NEW

An earnings summary card that counts up the total, plots a scrubable trend line, and breaks income down by source with a hoverable split bar and a 7D / 30D / 12M period switcher. Light and dark themes, fully responsive.

Earnings

Earnings

$0.00

14%vs previous 30 days

Next payout · Nov 5$1,240.00
Earnings, 30D
SourceAmountShare
Sponsors$2,445.9038%
Pro licenses$2,188.4334%
Affiliate$901.1214%
Donations$579.299.0%
Courses$321.835.0%

Installation

Add the component directly to your repository using shadcn CLI:

npx shadcn@latest add Surajmaurya1/easyui/earnings

API Reference

PropTypeDefaultDescription
periodsEarningsPeriod[]—Period datasets, each with its trend, optional previous total, and income sources
defaultPeriodstringsecond period when 3+ existID of the period shown first
onPeriodChange(id: string) => voidundefinedCalled when the active period changes
titlestring'Earnings'Card heading and default readout label
currencystring'USD'ISO currency code passed to Intl.NumberFormat
localestring'en-US'Locale used for currency formatting
payout{ label?: string; date: string; amount?: number }undefinedOptional footer line for the next payout
animatedbooleantrueCounts numbers up and animates the chart on mount; reduced motion always wins
classNamestring''Additional CSS classes for the card root
EarningsPeriod.idstring—Unique period identifier used by the switcher
EarningsPeriod.labelstring—Segmented-control label such as "30D"
EarningsPeriod.comparisonstring—Caption under the delta, e.g. "vs previous 30 days"
EarningsPeriod.totalnumber—Headline total; defaults to the sum of the sources
EarningsPeriod.previousnumber—Previous-period total used to compute the delta
EarningsPeriod.trendnumber[]—Earnings per point, ordered oldest to newest
EarningsPeriod.trendLabelsstring[]—Names for each trend point, shown while scrubbing
EarningsPeriod.sourcesEarningsSource[]—Income sources with amount, optional change, color, and icon
EarningsSource.idstring—Unique source identifier
EarningsSource.labelstring—Source name used in the list and readout
EarningsSource.amountnumber—Amount earned from this source in the period
EarningsSource.changenumber—Percent change versus the previous period
EarningsSource.colorstring—Any CSS color; defaults to a palette entry
EarningsSource.iconReactNode—Optional icon; defaults to a colored initial