# Attendance card

> Canonical HTML: https://screenrig.ai/docs/cards/attendance/

Today's attendance by class as rings, with the whole school together, classes at or above the goal marked, and positive streaks. Counts only, never names.

Category: Schools. Tags: Schools and campuses, Charts and gauges, Numbers and metrics.

## Previews

![Attendance](/cards/attendance/v1/screenshots/canvas-bloom.webp?sha=934d91d9b629173013bd0cbc130af26038ac53d17f9e9b3419c029d3fc942194)

Canvas

![Attendance](/cards/attendance/v1/screenshots/corner-bloom.webp?sha=69ddd16eed500425ac3bcb7df7109f93e0fedaf7a87946658d8ffba28bfa8ca8)

Corner

![Attendance](/cards/attendance/v1/screenshots/chip-bloom.webp?sha=3db71ff8632217cd06fded3501b28e885c7f2d92ad6217eb8180a1dfe2ce7c0b)

Chip

## Views and forms

Views: canvas, corner, chip. Canvas forms: landscape, portrait, square, strip.

[Card views, themes and publishing](/docs/cards/). [Browse the gallery](/apps/#cards).

## Data and privacy

This card uses its configured properties and live card data.

Counts only, never names.

## Properties

For theme, background, accent and position, see [Common properties](/docs/cards/#common-properties).

Set static properties in `params`. Bind `data` to a project card data key for live values; that document holds only dynamic properties. Without a data key, put the complete configuration in `params`. Nested rows describe the contents of their parent property.

### Static properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `goal` | integer | `95` | minimum: `1`; maximum: `100` | The attendance percentage a class or the school reaches to count as on track. |
| `showDate` | boolean | `true` |  |  |
| `hour12` | boolean | `false` |  |  |
| `timeZone` | string, null | `null` |  |  |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `title` | string | `"Attendance today"` | maxLength: `40` |  |
| `classes` | array | `[]` | minItems: `0`; maxItems: `16` | Today's attendance by class: how many are here of how many are enrolled. A class that has not reported yet leaves present out. Counts only, never names. |
| `classes[].name` | string |  | minLength: `1`; maxLength: `28`; Required |  |
| `classes[].enrolled` | integer |  | minimum: `1`; maximum: `9999`; Required |  |
| `classes[].present` | integer |  | minimum: `0`; maximum: `9999` | Here today. Absent: the class has not reported yet. |
| `classes[].streak` | integer | `0` | minimum: `0`; maximum: `999` | Days in a row at or above the goal. |
| `schoolStreak` | integer | `0` | minimum: `0`; maximum: `999` | Days in a row the whole school was at or above the goal. |
| `takenAt` | string | `""` | maxLength: `40` | ISO 8601 instant attendance was taken. Empty shows no time. |

## Canvas example

Add this item to a playlist page’s `primitives`. [Publish the playlist and assign a screen](/docs/cards/#publish-a-card-canvas).

```json
{
  "id": "attendance",
  "primitive": "card",
  "card": "attendance",
  "major": 1,
  "params": {
    "theme": "neomustard"
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "attendance-main"
}
```

## Write live data

Create this document before showing the card, then replace it to update the screen without republishing. Use the same project as the playlist. Supply your API authorization through the environment; see [API authentication](/docs/authentication/).

```console
curl --request PUT "https://api.screenrig.ai/api/card-data/attendance-main" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "ScreenRig-Project: $SCREENRIG_PROJECT" \
  --header "Content-Type: application/json" \
  --data '{"document":{"title":"Attendance today","classes":[],"schoolStreak":0,"takenAt":""}}'
```
