Ballmac UI home

Gradebook 1: class grades

A teacher's gradebook: students down, assignments across, type a score and the weighted average and letter grade update, ungraded work is left out rather than counted as zero, failing students are marked in words, a bad score is refused.

State

The normal view. Pick a state to see what the block shows while it loads, is empty or fails.

Open in v0 (opens in a new tab)

Installation

$ pnpm dlx shadcn@latest add @ballmac/gradebook-1

Usage

Example: gradebook-1-demo.tsx
"use client"

import { Gradebook1 } from "@/components/ballmac/blocks/gradebook-1/gradebook-1"

export default function Gradebook1Demo() {
  return <Gradebook1 />
}

States

Pass state and the block does the rest: skeletons that match its layout, a clear empty message, an error you can retry, and announcements for screen readers.

  • Loading

    Skeleton grid under the real heading, announced as loading.

    state="loading"
  • No students yet

    Says no students yet; emptyState sets the copy.

    state="empty"
  • Could not load

    An alert saying no score was changed, with Try again (onRetry). A score that fails to save is put back and says why.

    state="error"

Dependencies

Use with AI

Gradebook. <Gradebook1 students={[{ id, name }]} assignments={[{ id, title, max, weight }]} scores={{ 'studentId:assignmentId': 18 }} passMark={50} onScoreChange={(studentId, assignmentId, score|null) => Promise} />. Averages are weighted over graded work only. Scores above the maximum or below 0 are refused with a message. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Gradebook 1: class grades (@ballmac/gradebook-1) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • A teacher's marking screen
  • Any grid of people against weighted tasks

Not for

  • A report card for parents
  • A spreadsheet with free formulas; use data-grid

Registry JSON: https://ui.ballmac.com/r/gradebook-1.json

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.