# Manifest

> The fields of a component manifest: identity, libraries, locales, assets, size and permissions.

> Esta página ainda não tem tradução para o português; este é o texto em inglês. (This page is not translated yet: the English text follows.)

> 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.

## Manifest fields

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](#named-types) | yes | The component's name inside its project: lowercase words joined by hyphens. |
| `tag` | [TagName](#named-types) | 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](../props/#propdeclaration) (keys: [PropName](#named-types)), 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](../events-and-slots/#eventdeclaration) (keys: [MemberName](#named-types)), at most 20 entries | no | The events the component dispatches on its host element, by name. |
| `slots` | map to [SlotDeclaration](../events-and-slots/#slotdeclaration) (keys: [MemberName](#named-types)), at most 10 entries | no | The slots the host page can fill with its own markup, by name. |
| `parts` | map to [PartDeclaration](../events-and-slots/#partdeclaration) (keys: [MemberName](#named-types)), at most 30 entries | no | The shadow parts a site can style from outside with `::part()`, by name. |
| `cssVars` | map to [CssVarDeclaration](../events-and-slots/#cssvardeclaration) (keys: [CssVarName](#named-types)), at most 30 entries | no | The CSS custom properties a site can set to theme the component, by name (with the leading `--`). |
| `data` | [DataDeclaration](../data/#datadeclaration) | no | What the component collects or tracks: collections of submissions and declared interactions. |
| `size` | [SizeHints](#sizehints) | no | Layout hints that reserve space for the component before it renders, so the page does not jump. |
| `permissions` | [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](#named-types)), 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](#localesdeclaration) | no | The languages the component ships messages for. |
| `assets` | map to [AssetDeclaration](#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. |

## SizeHints

| 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. |

## Permissions

| 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. |

## LocalesDeclaration

| 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`. |

## AssetDeclaration

| 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. |

## Named types

| 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) |
