Appearance
Contract reference
The <contract> block is JSON (comments and trailing commas allowed). This page is generated from the contract JSON Schema, which editors can use too. See Contracts for the ideas behind it.
| Field | Type | Required | |
|---|---|---|---|
name | string | yes | PascalCase component name. Must match the file name. |
role | one of 82 values | yes | The ARIA role of the component root. |
description | string | no | What the component is for. |
parts | array | yes | The public anatomy: documented class names. Must include "root". |
variants | object | no | Variant name to allowed values. The first value is the default. |
states | array | no | States the component can be in, for example "hover" or "disabled". |
behavior | string | no | Headless interaction behavior to attach, for example "press". |
slots | object | no | Slot name to description. |
events | object | no | Event name to description. |
contrast | array | no | Foreground and background parts whose colors are checked for contrast. |
since | string | no | Version that introduced the component. |
deprecated | string | no | Why the component is deprecated and what to use instead. |
renamedFrom | string | no | Previous component name, used by codemods. |
deprecatedValues | object | no | Variant name to the values that are deprecated, each with why and what to use instead. The values stay allowed. |
renamedValues | object | no | Variant name to values that were renamed, each old value mapped to its replacement. Used by codemods; the old value is no longer allowed. |
forkedFrom | object | no | Set by tessera eject: the system component this was copied from. |
Roles
alert, alertdialog, application, article, banner, blockquote, button, caption, cell, checkbox, code, columnheader, combobox, complementary, contentinfo, definition, deletion, dialog, directory, document, emphasis, feed, figure, form, generic, grid, gridcell, group, heading, img, insertion, link, list, listbox, listitem, log, main, marquee, math, menu, menubar, menuitem, menuitemcheckbox, menuitemradio, meter, navigation, none, note, option, paragraph, presentation, progressbar, radio, radiogroup, region, row, rowgroup, rowheader, scrollbar, search, searchbox, separator, slider, spinbutton, status, strong, subscript, superscript, switch, tab, table, tablist, tabpanel, term, textbox, time, timer, toolbar, tooltip, tree, treegrid, treeitem