Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Count By Year Awards Block for React

A split for a flood-risk analytics tool: a header and a toggle at the start and, at the end, a ruled list of years from 2019 to 2025, each a horizontal bar and its count, counting either awards or programmes.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A count of awards by year for React with Base UI. At the start of a split sit a header with the tally counted from the list ("23 awards from 3 programmes since 2019") and a two-option toggle, Awards or Programmes. At the end is a ruled list of years, 2019 to 2025, each with a bar drawn from the count over the highest count and the number beside it; the best year is outlined and named in its row. Switching the toggle redraws every bar in place and a polite line says which year is best. The page's rails and top rule come from the Guides spine, and a divider with a + mark where it meets the top rule separates the halves. It's built from Guides, Toggle Group and your theme's tokens, with CSS transitions for the bars. The programmes and awards are made up for the example: replace them with your own.

FAQ

How do I change the awards?

Edit AWARDS at the top of the file. Each entry is a programme and a year, a fixed number: an award given in 2024 stays 2024. The years on the list run from the earliest to the latest year in the data, a year with no awards shows a zero, and the header's tally is counted from the same list, so it can't disagree with the bars.

What does the Programmes option count?

How many different programmes gave at least one award in that year, so a year with six awards from three programmes shows 6 under Awards and 3 under Programmes. Add a metric by adding an entry to METRICS whose rows come from rowsOf with a function that counts one year. The best year is the one with the highest count, and a tie goes to the newer year.

How long is a bar?

Its count divided by the highest count in the list, so the longest bar always fills its track and the others are in proportion. Bars change length with a short CSS transition, and under reduced motion they change at once. The bars are drawn in the same order on a right-to-left page; only the year and the count follow the reading direction.

How does it read to a screen reader?

The years are a list named after the metric. Each row reads as its year and count with the unit ("2024, 6 awards"), and the best row adds "Best year". The bars are drawings hidden from assistive technology. After each change the polite status line speaks the metric and the best year, so the change is announced without moving focus.

Is anything told by colour alone?

No. The best year is outlined, its bar is solid, and its row says "Best year" (on a phone the word moves into the status line under the toggle). Every other bar is a lighter step of your foreground colour. Nothing uses a status or brand colour.

Are these real awards?

No. Highwater, Amberdale, Russetholm and Cloverford are made up. Swap in your own awards, programmes and years; if you show a real award, use its name in text.

  • Pro

    Growth Staircase Awards

    Charts and figures

    A 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

    A single framed cell for a usage-metering API with one large rolling number and a row of year buttons: choosing a year rolls the running total of awards to that year and lists its three newest awards.

  • Pro

    Category Counts Awards

    Charts and figures

    Nine count tiles on shared hairlines for a sports-league manager: a drawn category glyph, the count in large type, its share of all awards and a bar scaled to the largest, with the largest outlined.

  • Pro

    One 100% bar split by award category above eight count pills; pressing a pill emphasises its segments and filters the list below.

  • Pro

    Year In Review Awards

    Charts and figures

    A recap of 2025 for a podcast app: a 2025 compared with 2024 description list of four figures with their change in words, a ranked list of the top three awards with drawn seals and three dated milestones.

  • Pro

    A vertical rail of awards by year for a planning tool, a node for each year on a solid hairline with its awards as rows, and the older years behind a View earlier years Collapsible.