# School lunch card

> Canonical HTML: https://screenrig.ai/docs/cards/school-lunch/

Today's school meal with allergen marks, and the days ahead: the main dish big, the sides listed, a key for the marks.

Category: Food and drink. Tags: Schools and campuses, Restaurants and cafes.

## Previews

![School lunch](/cards/school-lunch/v1/screenshots/canvas-bloom.webp?sha=0720c9898e213f7300280622a6d6f5d611c278b067f4c8b5e54ba2cd37c218cd)

Canvas

![School lunch](/cards/school-lunch/v1/screenshots/corner-bloom.webp?sha=621004d00956a435d82d094eb13cbad90fe766d70d9b569abb6fa4b9b1c1f472)

Corner

![School lunch](/cards/school-lunch/v1/screenshots/chip-bloom.webp?sha=25b05ff5aa5cc8def73b4ea4e05d0fa59b38b69a2258356e2dbb07cd44b4683b)

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

Feed: `screenrig.lunch/v1`.

Feed documents carry source attribution. The Player supplies the feed to the card.

## 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 | `""` | maxLength: `40` | Empty reads School lunch (School breakfast, School snack). |
| `school` | string | `""` | maxLength: `60` | Shown beside the title. A feed's school name fills it when empty. |
| `meal` | string | `"lunch"` | `"breakfast"`, `"lunch"`, `"snack"` |  |
| `count` | integer | `4` | minimum: `1`; maximum: `6` | Days listed after the featured day. |
| `showAllergens` | boolean | `true` |  | Allergen and diet marks and their key. |
| `timeZone` | string, null | `null` |  |  |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `days` | array | `[]` | minItems: `0`; maxItems: `31` | The menu by day. A feed (screenrig.lunch/v1) wins when present; the data store supplies the same rows otherwise. |
| `days[].date` | string |  | maxLength: `10`; Required | YYYY-MM-DD in the screen's zone. |
| `days[].closed` | boolean | `false` |  | No meal this day (holiday, no school). |
| `days[].note` | string |  | maxLength: `80` | Shown on the day: Pizza day, or why there is no school. |
| `days[].items` | array |  | maxItems: `12` | The meal in order; the first item is the main dish. |
| `days[].items[].name` | string |  | minLength: `1`; maxLength: `60`; Required |  |
| `days[].items[].allergens` | array |  | maxItems: `10` | milk, egg, fish, shellfish, tree nuts, peanuts, wheat, soy, sesame. Each shows as a two-letter mark. |
| `days[].items[].diet` | string |  | `"vegetarian"`, `"vegan"` | Shows a V or VG mark. |
| `days[].meals` | array |  | maxItems: `4` | A feed's meals for the day; the card's meal picks one. Without meals the day's items are used. |
| `days[].meals[].kind` | string |  | `"breakfast"`, `"lunch"`, `"snack"`; Required |  |
| `days[].meals[].items` | array |  | maxItems: `12`; Required |  |
| `days[].meals[].items[].name` | string |  | minLength: `1`; maxLength: `60`; Required |  |
| `days[].meals[].items[].allergens` | array |  | maxItems: `10` | milk, egg, fish, shellfish, tree nuts, peanuts, wheat, soy, sesame. Each shows as a two-letter mark. |
| `days[].meals[].items[].diet` | string |  | `"vegetarian"`, `"vegan"` | Shows a V or VG mark. |

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