OKHAM.org Documentation EnglishCastellano

OUCC · Open UI Component Contract

An Open UI Component Contract (OUCC) describes a reusable part of a user interface from the point of view of the application that embeds it. The publisher gives the component an identity and version and can describe the data it accepts, where child content belongs, and which events it emits. A client can use the same declaration to discover a component and understand how to interact with it.

Scope and rendering

The public interface describes how the component fits into a screen. Optional rendering profiles pair an engine with an artifact that implements that interface. A client can choose a profile it supports and locate the matching artifact. The contract can also carry localisation and accessibility information for that client.

The renderer and the selected artifact determine the appearance and behaviour the user actually experiences. An artifact digest can establish which file the client loaded. Keyboard operation, focus management and accessible names need to be checked in the rendered component.

Field reference

Read each table within its named object. A required field must be present whenever that object is supplied. Brackets ([]) denote one array entry. Each object in the tables accepts additional properties.

Document

Field JSON type Required Meaning and constraints
component string Yes OUCC schema version. Use three dot-separated numbers.
id string Yes Unique component ID. Start with a letter, followed by letters, digits, underscores or hyphens.
name string Yes Human-readable name. Must be nonempty.
version string Yes Component semantic version. Use three dot-separated numbers.
a11y object No Accessibility metadata.
category string No Component category. Allowed values are layout, form, data-display, navigation, feedback.
description string No Component description.
events array of objects No Signals the component can emit. Each entry is an open object.
i18n object No Internationalization metadata.
profiles array of objects No Rendering profiles.
props array of objects No Data the component accepts. Each entry is an open object.
slots array of objects No Places where a client can supply child content. Each entry is an open object.
status string No Lifecycle status. Allowed values are draft, stable, deprecated, removed.
tags array of strings No Terms a client can use to find this component.

profiles[]

Field JSON type Required Meaning and constraints
engine string Yes Rendering engine identifier. Start with a lowercase letter, followed by lowercase letters, digits, underscores or hyphens. Length: 2–50 characters.
artifact object Yes Rendering artifact reference.

profiles[].artifact

Field JSON type Required Meaning and constraints
kind string Yes How the renderer locates the artifact. Allowed values are file, uri, kv.
path string No Relative path for file artifacts.
sha256 string No SHA-256 checksum. Use 64 lowercase hexadecimal characters.

Example: rendering a header

The optional profiles list describes rendering choices. Each entry requires an engine and an artifact object. The artifact requires kind (file, uri or kv). It can include a path and a lowercase, 64-character hexadecimal sha256 digest. Profile and artifact objects accept additional properties.

The example declares title and subtitle as string properties, names the templ engine, and gives the file path header.templ with its digest. A client using this profile needs to resolve that file and have a compatible engine.

Edition 0.2.0 · JSON Schema · Full example

Read the specification on GitHub