Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Winning Streak Awards Block for React

Chains of year nodes for a language-learning app: a check for a year won, a hollow node for a year not won, a link joining consecutive wins, with the current streak counted large for the lead category.

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

Winning streaks for React with Base UI. A start-aligned header with a two-item legend at its end sits above a band of three chains, one for each category, ruled from rail to rail with + marks and ending the block. A chain is an ordered list of year nodes, from 2019 to 2025: a filled node with a check for a year won, a hollow node for a year not won, and a solid link joining two consecutive wins. The current streak (the unbroken run of wins that ends in the latest year) is counted large for the lead category, which comes first, and smaller for the two shorter chains, each with its base ("6 of 7 editions won"). The chains read in time order in both text directions. It's built from Guides, a check icon and your theme's tokens. The Slateton Awards and the wins are made up for the example.

FAQ

How do I change the wins?

Edit LEAD and CHAINS at the top of the file. Each chain has an id, a name and wins: the years it won, each a fixed number. FIRST_YEAR and LAST_YEAR set the window of editions drawn. The links, the streaks and the "5 of 7 editions won" lines are all counted from the lists; nothing else needs editing.

What counts as the current streak?

The unbroken run of wins that ends in the latest year in the window. A category that skipped the latest year has a streak of zero, and a category that missed a year in the middle starts counting again after it. runFrom counts back year by year until it finds a gap.

How do the chains fit a phone?

Seven nodes share a row in a grid, the nodes and their years shrink, and each row stacks its heading and streak above the chain. They fit down to 320 pixels, so nothing scrolls sideways. If you widen the window past about nine years, wrap each chain in a region that scrolls sideways and takes focus.

How do screen readers read a chain?

Each chain is an ordered list named with its category and the range of editions. Each item reads as its year followed by "won" or "not won", and the drawn nodes and links are hidden from assistive technology. The legend and the streak are plain text. Years sit in bdi elements and the chains are drawn left to right in a right-to-left layout too, since time reads that way.

Why is a win not shown in colour?

A year won is a filled node with a check and a year not won a hollow one, so the difference is shape and fill, never hue. It reads the same in any theme and for anyone who can't tell colours apart.

Are these real awards?

No. The Slateton Awards, the categories and the wins are made up, and Barnabas is a made-up app. Use your own record, and a real programme's name in text only.

  • Pro

    Total Tally Awards

    Lists and tables

    A 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

    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.

  • Pro

    Count By Year Awards

    Charts and figures

    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.

  • 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

    Medal Count Awards

    Rankings and scores

    An Olympic-style medals table for a league-tables service: seven product lines ranked by gold, then silver, with drawn medal heads, a total, a stated ranking rule and a top-line callout.

  • Pro

    A hall of fame of seven open-source contributors in three inducted classes, each an engraved plaque with an oval monogram medallion, a one-line contribution and its class year.