DesignComponent design.component@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
design
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/design/component.v1.json

design.component@1: a platform-neutral OpenVibe interface definition served by openvibe.design/api/v1/components.

Fields

FieldTypeRequiredDescriptionConstraints
schemaconstyes
  • = "design.component@1"
namestringyes
  • pattern ^[a-z][a-z0-9-]{0,63}$
titlestringyes
  • minLength 1
  • maxLength 120
summarystringyes
  • minLength 1
  • maxLength 500
anatomyarray of objectyes
  • minItems 1
  • maxItems 32
  • items: no other fields
anatomy[].partstringyes
  • minLength 1
  • maxLength 80
anatomy[].rolestringyes
  • minLength 1
  • maxLength 300
propsobjectyes
statesarray of stringyes
  • minItems 1
  • maxItems 30
  • unique items
  • items: minLength 1
  • items: maxLength 80
tokensarray of stringyes
  • minItems 1
  • maxItems 50
  • unique items
  • items: minLength 1
  • items: maxLength 100
behaviorsobjectyes
  • no other fields
behaviors.keyboardAwarebooleanyes
behaviors.outsideTapClosesbooleanyes
behaviors.scrollLockbooleanyes
behaviors.reducedMotionstringyes
  • minLength 1
  • maxLength 300
accessibilityobjectyes
  • no other fields
accessibility.namestringyes
  • minLength 1
  • maxLength 300
accessibility.targetstringyes
  • minLength 1
  • maxLength 300
accessibility.focusstringyes
  • minLength 1
  • maxLength 300
platformsobjectyes
  • no other fields
platforms.webobjectyes
  • no other fields
platforms.web.modulestringyes
  • minLength 1
platforms.web.markupstringyes
  • minLength 1
platforms.web.demostringyes
  • pattern ^/components/[a-z0-9-]+$
platforms.androidobjectyes
  • no other fields
platforms.android.toolkitconstyes
  • = "Jetpack Compose"
platforms.android.material3stringyes
  • minLength 1
platforms.android.specificationstringyes
  • minLength 1
platforms.iosobjectyes
  • no other fields
platforms.ios.toolkitconstyes
  • = "SwiftUI"
platforms.ios.specificationstringyes
  • minLength 1
examplesarray of objectyes
  • minItems 1
  • maxItems 20
  • items: no other fields
examples[].titlestringyes
  • minLength 1
examples[].propsobjectyes

Examples

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

Valid: sheet
{
  "schema": "design.component@1",
  "name": "sheet",
  "title": "Sheet",
  "summary": "A modal task surface: one heading, one close action and scrollable content.",
  "anatomy": [
    {
      "part": "handle",
      "role": "touch affordance"
    },
    {
      "part": "header",
      "role": "title and close"
    },
    {
      "part": "body",
      "role": "task controls"
    }
  ],
  "props": {
    "title": "string",
    "open": "boolean",
    "body": "content"
  },
  "states": [
    "closed",
    "opening",
    "open",
    "closing"
  ],
  "tokens": [
    "color.bg.card",
    "color.line.strong",
    "radius.lg"
  ],
  "behaviors": {
    "keyboardAware": true,
    "outsideTapCloses": true,
    "scrollLock": true,
    "reducedMotion": "Remove movement; keep the state change."
  },
  "accessibility": {
    "name": "Sheet",
    "target": "At least 44 × 44 dp or pt for every touch action",
    "focus": "Trap focus while open; Escape closes and returns focus"
  },
  "platforms": {
    "web": {
      "module": "openvibe-shared/kit",
      "markup": "kit.sheet({ id, title, body })",
      "demo": "/components/sheet"
    },
    "android": {
      "toolkit": "Jetpack Compose",
      "material3": "SurfaceContainerHigh",
      "specification": "Use ModalBottomSheet with a heading, close control and sheet state."
    },
    "ios": {
      "toolkit": "SwiftUI",
      "specification": "Use .sheet with a NavigationStack and a toolbar close button."
    }
  },
  "examples": [
    {
      "title": "Default",
      "props": {
        "title": "Add a site"
      }
    }
  ]
}
Rejected: no-android
{
  "schema": "design.component@1",
  "name": "sheet",
  "title": "Sheet",
  "summary": "A modal task surface: one heading, one close action and scrollable content.",
  "anatomy": [
    {
      "part": "handle",
      "role": "touch affordance"
    },
    {
      "part": "header",
      "role": "title and close"
    },
    {
      "part": "body",
      "role": "task controls"
    }
  ],
  "props": {
    "title": "string",
    "open": "boolean",
    "body": "content"
  },
  "states": [
    "closed",
    "opening",
    "open",
    "closing"
  ],
  "tokens": [
    "color.bg.card",
    "color.line.strong",
    "radius.lg"
  ],
  "behaviors": {
    "keyboardAware": true,
    "outsideTapCloses": true,
    "scrollLock": true,
    "reducedMotion": "Remove movement; keep the state change."
  },
  "accessibility": {
    "name": "Sheet",
    "target": "At least 44 × 44 dp or pt for every touch action",
    "focus": "Trap focus while open; Escape closes and returns focus"
  },
  "platforms": {
    "web": {
      "module": "openvibe-shared/kit",
      "markup": "kit.sheet({ id, title, body })",
      "demo": "/components/sheet"
    },
    "ios": {
      "toolkit": "SwiftUI",
      "specification": "Use .sheet with a NavigationStack and a toolbar close button."
    }
  },
  "examples": [
    {
      "title": "Default",
      "props": {
        "title": "Add a site"
      }
    }
  ]
}
Rejected: no-ios
{
  "schema": "design.component@1",
  "name": "sheet",
  "title": "Sheet",
  "summary": "A modal task surface: one heading, one close action and scrollable content.",
  "anatomy": [
    {
      "part": "handle",
      "role": "touch affordance"
    },
    {
      "part": "header",
      "role": "title and close"
    },
    {
      "part": "body",
      "role": "task controls"
    }
  ],
  "props": {
    "title": "string",
    "open": "boolean",
    "body": "content"
  },
  "states": [
    "closed",
    "opening",
    "open",
    "closing"
  ],
  "tokens": [
    "color.bg.card",
    "color.line.strong",
    "radius.lg"
  ],
  "behaviors": {
    "keyboardAware": true,
    "outsideTapCloses": true,
    "scrollLock": true,
    "reducedMotion": "Remove movement; keep the state change."
  },
  "accessibility": {
    "name": "Sheet",
    "target": "At least 44 × 44 dp or pt for every touch action",
    "focus": "Trap focus while open; Escape closes and returns focus"
  },
  "platforms": {
    "web": {
      "module": "openvibe-shared/kit",
      "markup": "kit.sheet({ id, title, body })",
      "demo": "/components/sheet"
    },
    "android": {
      "toolkit": "Jetpack Compose",
      "material3": "SurfaceContainerHigh",
      "specification": "Use ModalBottomSheet with a heading, close control and sheet state."
    }
  },
  "examples": [
    {
      "title": "Default",
      "props": {
        "title": "Add a site"
      }
    }
  ]
}

Validate

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