Skip to content

Class Roster

The teacher's list of a class: search, today's attendance in one press, the average so far and when each student was last active.

On this page
Used for
  • A teacher's start-of-lesson screen
  • Taking attendance
  • Finding who has gone quiet

Examples

Installation

npx knowns-ui@latest add class-roster
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

students
RosterStudent[]
id, name, and optionally email, lastActiveMs and average (0 to 100).
attendance
Record<string, Attendance>
Today's status by student id. A student with none shows Not marked.
onAttendanceChange
(id, next) => void
Fired when the chip is pressed with the next status. Leave it out for a read-only chip.
onSelectStudent
(id) => void
Makes rows clickable.
onMarkAllPresent
() => void
Shows Mark all present while anyone is unmarked.
now
number
Defaultreal time
The clock for the last-active column. Pass a fixed value in tests and docs.
pageSize
number | false
Defaultfalse
Rows per page, or one scrolling list.

What it handles

  1. 01Searches by name or email as you type, and sorts by any column.
  2. 02Cycles today's status with one press: Present, Late, Absent, Excused. The summary line counts the room as it changes.
  3. 03Shows the running average and when each student was last active, as words that stay correct while the page is open.
  4. 04Marks every student who is not marked yet as present in one press.
  5. 05Builds on the data table, so keyboard, sorting and long lists work the same way.

States

Status pressed
The chip changes colour and the room count ticks
120ms, ease-out
Search typed
Rows that do not match leave at once
0ms
Reduced motion
Colours change with no fade
0ms

Works with

When to use

When to use

  • The start of a lesson: who is here, who is late, who has gone quiet.
  • A class list that opens a student when a row is clicked.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Class Roster to my app and wire it to my own data.
  • I need the start of a lesson: who is here, who is late, who has gone quiet. Set that up with the Knowns UI Class Roster.
  • Which Class Roster props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "class-roster" }) and search_docs({ query: "class roster" }).

Need help?

Stuck on Class Roster, or found something off? We read every message.