# Safety counter card

> Canonical HTML: https://screenrig.ai/docs/cards/safety-counter/

Days without a lost-time incident, counted from the date of the last one, with the record streak and the goal.

Category: Operations. Tags: Factories and warehouses, Numbers and metrics, Offices and workplaces.

## Previews

![Safety counter](/cards/safety-counter/v1/screenshots/canvas-bloom.webp?sha=796b594f105431fff6f44986dfac7f9ea375a5ecbb46bea05230ec1296ff99ad)

Canvas

![Safety counter](/cards/safety-counter/v1/screenshots/corner-bloom.webp?sha=8d97fd93d1c33c22b3bc952beb77e0cbdeca998aca350334002488de8bc6605d)

Corner

![Safety counter](/cards/safety-counter/v1/screenshots/chip-bloom.webp?sha=9123a333972f83ceb115a047545c802c38e48d2c1682441d09ee3ad3d37dbc82)

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.

## 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 |
| --- | --- | --- | --- | --- |
| `title` | string | `"Safety"` | maxLength: `40` |  |
| `label` | string | `"without a lost-time incident"` | maxLength: `80` | The words after the number of days: "days without a lost-time incident". |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `lastIncident` | string | `""` | maxLength: `10`; pattern: `"^(\\d{4}-\\d{2}-\\d{2})?$"` | The date of the last incident, YYYY-MM-DD in the screen's time zone. The count is the calendar days since, and rolls over at local midnight. |
| `record` | integer | `0` | minimum: `0`; maximum: `99999` | The longest streak on record, in days. 0 hides it. A streak that reaches it is the record. |
| `target` | integer | `0` | minimum: `0`; maximum: `99999` | The goal, in days. 0 hides it. |
| `footnote` | string | `""` | maxLength: `120` | A line for the foot of the board: a reminder or a reporting line. |

## 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": "safety-counter",
  "primitive": "card",
  "card": "safety-counter",
  "major": 1,
  "params": {
    "theme": "neomustard"
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "safety-counter-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/safety-counter-main" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "ScreenRig-Project: $SCREENRIG_PROJECT" \
  --header "Content-Type: application/json" \
  --data '{"document":{"lastIncident":"","record":0,"target":0,"footnote":""}}'
```
