---
title: "ui.element-state@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/ui.element-state"
updated: null
---

# ui.element-state@1 · OpenVibe.Services

HTML: [ui.element-state@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/ui.element-state)

# UiElementState `ui.element-state@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

- Version: 1.0.0
- Owner: contracts
- Visibility: public
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/ui/element-state.v1.json`](/docs/contracts/ui.element-state.json)

ui.element-state@1: the small store an Element keeps for itself (counters, scores, lists, a wheel's entries), as Live broadcasts it to everyone watching and as a read returns it. CHANNEL and ELEMENT\_ID name the element instance, REVISION grows by one with each accepted change so a late frame never overwrites a newer one, and VALUES is the store itself: at most 32 keys, each a boolean, a number, a short string or a list of those. It is state, not code: no objects, no markup, no URL and no account data, which keeps a shared element's state safe to render for every viewer.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `channel` | string | yes | The Live channel's username (its slug). | - `pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$` |
| `element_id` | string | yes |  | - `pattern ^el_[0-9A-HJKMNP-TV-Z]{26}$` |
| `revision` | integer | yes |  | - `minimum 0` |
| `values` | `https://openvibe.network/contracts/ui/element-state.v1.json#/$defs/values` | yes |  |  |
| `updated_at` | string | yes |  | - `format date-time` |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: counter

~~~~
{
  "channel": "ada",
  "element_id": "el_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 4,
  "values": {
    "dances": 3,
    "last_presser": "Maticus",
    "wheel": [
      "a",
      "b",
      3
    ],
    "lit": true
  },
  "updated_at": "2026-11-11T20:31:00.000Z"
}
~~~~

Rejected: nested-value

~~~~
{
  "channel": "ada",
  "element_id": "el_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 1,
  "values": {
    "wheel": {
      "entries": [
        "a"
      ]
    }
  },
  "updated_at": "2026-11-11T20:31:00.000Z"
}
~~~~

Rejected: uppercase-key

~~~~
{
  "channel": "ada",
  "element_id": "el_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 1,
  "values": {
    "Dances": 1
  },
  "updated_at": "2026-11-11T20:31:00.000Z"
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('ui.element-state@1', value);   // { valid, errors: [{ path, message }] }
~~~~
