Skip to content

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.

FieldTypeRequired
namestringyesPascalCase component name. Must match the file name.
roleone of 82 valuesyesThe ARIA role of the component root.
descriptionstringnoWhat the component is for.
partsarrayyesThe public anatomy: documented class names. Must include "root".
variantsobjectnoVariant name to allowed values. The first value is the default.
statesarraynoStates the component can be in, for example "hover" or "disabled".
behaviorstringnoHeadless interaction behavior to attach, for example "press".
slotsobjectnoSlot name to description.
eventsobjectnoEvent name to description.
contrastarraynoForeground and background parts whose colors are checked for contrast.
sincestringnoVersion that introduced the component.
deprecatedstringnoWhy the component is deprecated and what to use instead.
renamedFromstringnoPrevious component name, used by codemods.
deprecatedValuesobjectnoVariant name to the values that are deprecated, each with why and what to use instead. The values stay allowed.
renamedValuesobjectnoVariant name to values that were renamed, each old value mapped to its replacement. Used by codemods; the old value is no longer allowed.
forkedFromobjectnoSet 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