Pular para o conteúdo

Props

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.

A prop is declared with a type. The runtime reads the attribute text of the custom element, checks it against the declaration and hands the component a typed value; text that does not fit falls back to the declared default.

Exactly one of:

  • type "string", fields below
  • type "number", fields below
  • type "boolean", fields below
  • type "enum", fields below
  • type "color", fields below
  • type "url", fields below
  • type "date", fields below
  • type "array", fields below
  • type "object", fields below
Field Type Required Description
type the constant "string" yes The prop type. It decides how the attribute text is read and which other fields apply.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
minLength integer, 0 to 10000 no Shortest text accepted, in characters.
maxLength integer, 1 to 10000 no Defaults to 10000.
format one of "email", "url", "tel", "date", "date-time" no A well-known text format the value must follow.
default string, at most 10000 characters no The value used when the attribute is missing or does not fit the declaration. Must fit the declaration itself.
Field Type Required Description
type the constant "number" yes The prop type. It decides how the attribute text is read and which other fields apply.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
min number no Smallest value accepted; dates are ISO text.
max number no Largest value accepted; dates are ISO text.
integer boolean no When true, only whole numbers are accepted.
default number no The value used when the attribute is missing or does not fit the declaration. Must fit the declaration itself.
step number, greater than 0 no A hint for editors (the step of a slider). It does not change what is accepted.
Field Type Required Description
type the constant "boolean" yes The prop type. It decides how the attribute text is read and which other fields apply.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
default the constant false no The value used when the attribute is missing or does not fit the declaration. Must fit the declaration itself.
Field Type Required Description
type the constant "enum" yes The prop type. It decides how the attribute text is read and which other fields apply.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
values array of EnumValue, 1 to 50 items, no repeats yes The allowed values, in the order an editor shows them.
default string, at most 64 characters no The value used when the attribute is missing or does not fit the declaration. Must fit the declaration itself.
Field Type Required Description
type the constant "color" yes The prop type. It decides how the attribute text is read and which other fields apply.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
default string, 1 to 64 characters, a fixed pattern (see the JSON Schema) no The value used when the attribute is missing or does not fit the declaration. Must fit the declaration itself.
Field Type Required Description
type the constant "url" yes The prop type. It decides how the attribute text is read and which other fields apply.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
protocols array of one of "https", "http", "mailto", 1 to 3 items, no repeats no Accepted URL schemes; defaults to [“https”].
default string, at most 2048 characters, a fixed pattern (see the JSON Schema) no The value used when the attribute is missing or does not fit the declaration. Must fit the declaration itself.
Field Type Required Description
type the constant "date" yes The prop type. It decides how the attribute text is read and which other fields apply.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
min string, a fixed pattern (see the JSON Schema) no Smallest value accepted; dates are ISO text.
max string, a fixed pattern (see the JSON Schema) no Largest value accepted; dates are ISO text.
default string, a fixed pattern (see the JSON Schema) no The value used when the attribute is missing or does not fit the declaration. Must fit the declaration itself.
Field Type Required Description
type the constant "array" yes The prop type. It decides how the attribute text is read and which other fields apply.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
items ValueSchemaDepth2 yes The schema every item of the array follows.
minItems integer, 0 to 1000 no Fewest items accepted.
maxItems integer, 1 to 1000 no Defaults to 1000.
default array of DefaultValueDepth2, at most 1000 items no The value used when the attribute is missing or does not fit the declaration. Must fit the declaration itself.
Field Type Required Description
type the constant "object" yes The prop type. It decides how the attribute text is read and which other fields apply.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
fields map to ValueSchemaDepth2 (keys: FieldName), at most 50 entries yes The fields of the object, by name.
required array of FieldName, 1 to 50 items, no repeats no The names of the fields that must be present. Each is one of fields.
default map to DefaultValueDepth2 (keys: FieldName), at most 50 entries no The value used when the attribute is missing or does not fit the declaration. Must fit the declaration itself.

Any of:

Any of:

  • string, at most 10000 characters or number or boolean
  • array of string, at most 10000 characters or number or boolean, at most 1000 items
  • map to string, at most 10000 characters or number or boolean (keys: FieldName), at most 50 entries

Declarative description of a JSON value. Plain data only: no code, no regular expressions.

Exactly one of:

Field Type Required Description
type the constant "array" yes The value type: string, number, boolean, enum, array or object.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
items ValueSchemaDepth2 yes The schema every item of the array follows.
minItems integer, 0 to 1000 no Fewest items accepted.
maxItems integer, 1 to 1000 no Defaults to 1000.
Field Type Required Description
type the constant "object" yes The value type: string, number, boolean, enum, array or object.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
fields map to ValueSchemaDepth2 (keys: FieldName), at most 50 entries yes The fields of the object, by name.
required array of FieldName, 1 to 50 items, no repeats no The names of the fields that must be present. Each is one of fields.

Exactly one of:

Field Type Required Description
type the constant "array" yes The value type: string, number, boolean, enum, array or object.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
items ValueSchemaDepth1 yes The schema every item of the array follows.
minItems integer, 0 to 1000 no Fewest items accepted.
maxItems integer, 1 to 1000 no Defaults to 1000.
Field Type Required Description
type the constant "object" yes The value type: string, number, boolean, enum, array or object.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
fields map to ValueSchemaDepth1 (keys: FieldName), at most 50 entries yes The fields of the object, by name.
required array of FieldName, 1 to 50 items, no repeats no The names of the fields that must be present. Each is one of fields.

Exactly one of:

Field Type Required Description
type the constant "array" yes The value type: string, number, boolean, enum, array or object.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
items ScalarValueSchema yes The schema every item of the array follows.
minItems integer, 0 to 1000 no Fewest items accepted.
maxItems integer, 1 to 1000 no Defaults to 1000.
Field Type Required Description
type the constant "object" yes The value type: string, number, boolean, enum, array or object.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
fields map to ScalarValueSchema (keys: FieldName), at most 50 entries yes The fields of the object, by name.
required array of FieldName, 1 to 50 items, no repeats no The names of the fields that must be present. Each is one of fields.

Exactly one of:

Field Type Required Description
type the constant "string" yes Always string.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
minLength integer, 0 to 10000 no Shortest text accepted, in characters.
maxLength integer, 1 to 10000 no Defaults to 10000.
format one of "email", "url", "tel", "date", "date-time" no A well-known text format the value must follow.
Field Type Required Description
type the constant "number" yes Always number.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
min number no Smallest value accepted.
max number no Largest value accepted.
integer boolean no When true, only whole numbers are accepted.
Field Type Required Description
type the constant "boolean" yes Always boolean.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
Field Type Required Description
type the constant "enum" yes Always enum.
description string, 1 to 300 characters, a fixed pattern (see the JSON Schema) no What this member is for; shown in docs, the portal and to agents.
values array of EnumValue, 1 to 50 items, no repeats yes The allowed values.
Type Attribute text accepted Value the component receives
string the text as is, within minLength/maxLength and the format the same string
number decimal (-1.5, 2e3; no +, spaces, hex, Infinity), up to 32 characters, within min/max/integer finite number (step is a hint only; -0 becomes 0)
boolean attribute presence, any text (even "false") true; absent = false
enum exactly one of the values the same string
color CSS value from the allowlist, up to 64 characters, balanced parentheses the same string (the runtime also requires CSS.supports)
url lowercase https://, http:// or mailto: as protocols allows, printable ASCII without space, quotes, <>, backtick or \, up to 2048 characters, accepted by new URL(), no userinfo; mailto: with one address and only subject/body the same string
date existing ISO date YYYY-MM-DD, within min/max the same ISO string
array JSON up to 32768 characters and 3 levels, checked against items a new list; inner objects keep only declared fields
object JSON up to 32768 characters and 3 levels, checked against fields/required a new object with only the declared fields