shadcn.io is not affiliated with official shadcn/ui
Giving Thermometer Philanthropy Awards Block for React
A giving thermometer for a charity-checkout widget, filled to the year's total with ticks at each quarter of the goal and a flag where a prize grant arrived, beside a ledger table of causes and amounts.
Installation
Overview
A giving thermometer for React with Base UI. A split: at the start, a header and a ledger table of five causes with each cause's round-ups, the matching (every round-up matched 1 to 1) and its total, then the prize grant and a totals row; at the end, a framed figure with a thermometer drawn in CSS and filled to the year's total against the annual goal, with ticks at 25, 50, 75 and 100% and a flag where the grant arrived. The total, its share of the goal and the grant's date are also in text. From lg the thermometer stands upright beside the ledger; below it the tube lies on its side above the table. Every figure is derived from the typed lists at the top. The page's rails and top rule come from the Guides spine. It's built from Guides, a native table and your theme's tokens. The Spruceford Prize, Openhand and the causes are made up for the example.
FAQ
How do I change the causes, the goal and the grant?
Edit the constants at the top of the file: CAUSES (a name and the round-up dollars each), MATCH_RATE (1 for matched 1 to 1), GRANT (its amount, what the fund held before it arrived, and its date) and GOAL. The ledger rows, the totals, the thermometer's fill, the flag's position and the share of the goal are computed from them, so the sums in the header, the table and the drawing always agree.
How is the thermometer drawn?
It is plain boxes, not a chart library: a tube with a bulb, a fill whose length is a CSS variable set from the total, a tick and a label for each quarter, and the flag. The same elements are positioned along the tube in both orientations, across on a phone and up from lg, so there is one drawing and nothing is duplicated. It is hidden from assistive technology; the total, the goal, the share and the grant are in the text beside it.
What does the flag mark?
The point on the goal the fund reached when the grant arrived: the amount it held before, plus the grant. Move GRANT.before and the flag moves with it. Its date is a fixed time element, never computed from today.
Related
- Pro
Impact Metrics Awards
Lists and tablesA ruled list of three awards for a CI/CD service, each with a drawn mark, the programme and year at the start and, at the end, the three measured results it recognised with the change in words.
- Pro
Unit Chart Social Impact Awards
Charts and figuresA unit chart of four volunteer programmes for a volunteer platform: a row of twenty person glyphs for each, filled to the people reached at 100 people a glyph, with the award each programme won.
- Pro
Total Tally Awards
Lists and tablesA scoreboard table for an accounting app: years down the side, the three tiers (grand prize, winner, finalist) and a total across, with column totals in the foot row, all counted from one list of entries.
- Pro
Connector Map Awards
Charts and figuresA reverse split for a spend-analytics tool: a framed map with four awards in a column at the start, the result each recognised at the end and hairline curves joining each pair, drawn bolder for the award you choose.
- Pro
Growth Staircase Awards
Charts and figuresA reverse split for a garden-centre till system: a framed staircase chart of the running total of awards by year with the three biggest years marked, beside the header and a list of three facts.
- Pro
Before After Awards
Charts and figuresThree awards for a help desk in cells on shared hairlines, each with two results drawn as before and after bars, and a segmented control that switches the large figure between the year before and the year of the award.