shadcn.io is not affiliated with official shadcn/ui
Gradient Fill Area Chart Stats Block for React
A cumulative earnings curve in a card in card, filled with the text colour fading in four stops, with dots on the curve where it crossed $10K, $50K and $100K.
Installation
Overview
A cumulative area chart for React with Base UI. A centred header says how long the first $100K took, then a card in card (a muted shell around a raised panel) holds the total earned since launch (rolling up once in view), the last month's takings and an eighteen-month curve. The fill under the curve is your text colour fading to nothing in four stops, so it follows light, dark and every preset without a colour gradient. Three dots sit on the curve where it crossed $10K, $50K and $100K, each placed between the two months it fell between and labelled above it with the month; on a phone the same milestones are a list under the chart. Everything is computed from one list of monthly takings. For creators, funds and any page that celebrates a total built up over time.
FAQ
How do I change the earnings and the milestones?
Edit MONTHLY (dollars taken in each month) and MILESTONES_AT at the top of the file. The running totals, the curve, the dots, the labels and the headline are computed from them. If the total goes past $120K, raise CEILING and the GRIDLINES.
How is the four-stop fade made?
The area is filled with the text colour at 30% and a CSS mask fades it from full strength under the line to 55%, 20% and then nothing at the foot of the chart. There is no gradient definition, so nothing needs a unique id, and the fade works in any theme.
How are the dots placed?
For each total the block finds the first month whose running total reached it, then interpolates along the straight segment the chart draws between that month and the one before. The dot's position and the label's position are the same percentages, so they stay with the curve at any width.
Is it accessible?
The chart is an image with a text name that gives the start, the end and the month each milestone was crossed. On a phone the milestones are a visible list; from sm the same list stays for screen readers while the labels above the dots are decorative. The total and the last month are a description list, values sit in bdi elements and the chart stays left to right in right-to-left pages.
Related
- Pro
Dual Series Area Chart Stats
Area and lineHome-solar generation against use over one day: two overlapping areas in two weights, the surplus hours hatched, a legend and a band of three totals under the chart.
- Pro
Area Chart Hero Stats
Area and lineA rail-to-rail area chart for a farm-shop sales tool: twelve months of sales fading out toward the foot, with the latest month's figure and its change laid over the top corner.
- Pro
Annotated Area Chart Stats
Area and lineA framed area chart of checkout latency with three numbered pins, two deploys and an incident, tied to an ordered list of notes under it; hovering or focusing either one lights the other.
- Pro
Area Chart With Pill Tabs Stats
Area and lineA framed area chart for a traffic analytics tool with pill tabs for Day, Week, Month and Year: choosing one swaps the readings, the labels under the chart and the total, whose digits roll.
- Pro
Sparkline Stats
SparklinesThree sparkline cells for a web-analytics tool, each with its figure for the last seven days, its change on the seven before and thirty days of line under a soft fade.
- Pro
Sparkline Hero Metric Stats
Hero metricA hero figure for a cash-planning tool beside its own 90-day trend: the runway in months at the start, and a wide line with its high, its low and today marked.