Pular para o conteúdo

Manifest

Este conteúdo não está disponível em sua língua ainda.

Generated from the contract schemas of @taggor/contract 1.10.0 by pnpm docs:contract; do not edit.

The manifest is the declarative half of a component. The SDK builds it from defineTaggorComponent; the build checks it against the schema below and the semantic rules of the contract.

The top level of the manifest. Props, events, slots, parts, CSS variables and data are detailed on their own pages.

Field Type Required Description
contractVersion string, a fixed pattern (see the JSON Schema) yes The contract version the manifest was written for, as major.minor.patch. The SDK sets it; the build accepts the versions it supports.
name ComponentName yes The component’s name inside its project: lowercase words joined by hyphens.
tag TagName yes The custom element tag the runtime registers on the site: lowercase, with a hyphen, and the workspace’s prefix (the API checks the prefix when the component is created).
title string, 1 to 80 characters, a fixed pattern (see the JSON Schema) yes A short human title, shown in the portal and in the gallery.
description string, 1 to 500 characters, a fixed pattern (see the JSON Schema) yes What the component is for, in one or two sentences; shown in the portal and to agents.
props map to PropDeclaration (keys: PropName), at most 50 entries no The props, by name. Each becomes an attribute of the element and a property of the Preact component’s props.
events map to EventDeclaration (keys: MemberName), at most 20 entries no The events the component dispatches on its host element, by name.
slots map to SlotDeclaration (keys: MemberName), at most 10 entries no The slots the host page can fill with its own markup, by name.
parts map to PartDeclaration (keys: MemberName), at most 30 entries no The shadow parts a site can style from outside with ::part(), by name.
cssVars map to CssVarDeclaration (keys: CssVarName), at most 30 entries no The CSS custom properties a site can set to theme the component, by name (with the leading --).
data DataDeclaration no What the component collects or tracks: collections of submissions and declared interactions.
size SizeHints no Layout hints that reserve space for the component before it renders, so the page does not jump.
permissions Permissions no What the component may ask of the browser: the web APIs it uses and the origins it may call.
libraries map to string, at most 256 characters (keys: LibraryName), at most 50 entries no Workspace-scoped libraries and the semver ranges this component is compatible with. Ownership is resolved by the API and builder.
locales LocalesDeclaration no The languages the component ships messages for.
assets map to AssetDeclaration (keys: string, at most 64 characters, pattern ^[0-9a-f]{64}$), at most 50 entries no The files bundled with the component (images and fonts), by the SHA-256 of their bytes. The build writes this; an author never does.
formAssociated boolean no True for a form field component: the element is form-associated, submits the value the component sets under its name attribute, takes part in the form’s validation, reset and disabled state, and delegates focus unless delegatesFocus is false. Defaults to false.
eventSampleRate number, 0.001 to 1 no Share of interaction and custom events the browser sends, from 0.001 to 1 (default 1: all). Render, error and conversion events are never sampled. Each stored event is weighted by 1 divided by this rate, so totals stay estimates of the real count.
delegatesFocus boolean no Whether the shadow root delegates focus: focusing the element, clicking one of its labels or a non-focusable part of it focuses the component’s first focusable element. Defaults to the value of formAssociated.
Field Type Required Description
display one of "block", "inline-block" no Defaults to “block”.
minHeight integer, 0 to 4000 no Reserved height in CSS pixels.
maxWidth integer, 1 to 4000 no Widest the component grows, in CSS pixels.
aspectRatio object no Width to height ratio the reserved space keeps before the component renders.
aspectRatio.width integer, 1 to 100 yes Width term of the ratio.
aspectRatio.height integer, 1 to 100 yes Height term of the ratio.
Field Type Required Description
apis array of one of "clipboard-write", "fullscreen", "geolocation", "web-share", 1 to 4 items, no repeats no Browser APIs the component may use. A site can only grant what is listed.
connect array of string, at most 2048 characters, a fixed pattern (see the JSON Schema), 1 to 10 items, no repeats no HTTPS origins the component may call with fetch, written as https://host or https://host:port, without a path or wildcard.
Field Type Required Description
supported array of string, at most 35 characters, pattern ^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$, 1 to 30 items, no repeats yes The language tags the component has messages for (en, pt-BR).
default string, at most 35 characters, pattern ^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$ yes The language used when none of the visitor’s languages is supported. One of supported.
Field Type Required Description
type one of "image/avif", "image/jpeg", "image/png", "image/svg+xml", "image/webp", "font/woff2" yes MIME type; the CDN path ends in its extension.
size integer, 1 to 2097152 yes Size of the file in bytes.
Name Type Limits
ComponentName string 1 to 64 characters, pattern ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$
TagName string 1 to 64 characters, a fixed pattern (see the JSON Schema)
PropName string 1 to 40 characters, a fixed pattern (see the JSON Schema)
EnumValue string 1 to 64 characters, pattern ^[^\u0000-\u001f\u007f]+$
FieldName string 1 to 40 characters, a fixed pattern (see the JSON Schema)
MemberName string 1 to 40 characters, pattern ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$
CssVarName string 1 to 64 characters, pattern ^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$
SnakeName string 1 to 40 characters, a fixed pattern (see the JSON Schema)
LibraryName string at most 100 characters, a fixed pattern (see the JSON Schema)