Staaarter

Study Streak Tracker

Gamified progress card showing a learner's current and longest study streaks as large stat numbers, plus a 7-cell Mon-Sun weekly activity calendar with filled cells for completed days.

By Staaarter Team
Education
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/study-streak-tracker.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/education/education10.tsx instead.

Usage

The file also exports education10Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Education10, education10Demo } from "@/components/blocks/education/education10";

export default function Page() {
  return <Education10 {...education10Demo} />;
}

Props

PropTypeDefaultDescription
badge{ label: string; variant?: BadgeVariant }nonePill above the heading; only rendered when badge is truthy.
headingReactNodenoneSection heading.
descriptionstringundefinedSupporting copy under the heading.
currentStreaknumbernoneCurrent streak length, rendered as a large stat number.
longestStreaknumbernoneLongest streak ever reached, rendered as a large stat number.
streakLabelstring"day streak"Unit label under both streak numbers.
weekWeekDayActivity[]noneExactly 7 entries (Mon-Sun) driving the weekly activity calendar cells.
classNamestringnoneExtra classes for the outer section element.

Types

type WeekDayActivity = {
  day: string;
  completed: boolean;
};

Behavior notes

  • Purely illustrative: the weekly calendar is 7 fixed cells rendered from the `week` array's `completed` booleans, there is no real date logic, no `new Date()`, and no client state.
  • A completed cell fills solid with a flame icon; an incomplete cell renders as an empty dashed outline.
  • The current and longest streak numbers are static props, not computed from `week`; a real integration would need to keep both in sync itself.
  • The component expects `week` to have 7 entries (Mon-Sun) to fill the grid evenly, but doesn't enforce that length at runtime.