Skip to content

Anatomy

The Anatomy is a map of named elements that make up a component’s structure. Each entry describes what kind of element it is and, optionally, where it was detected and what component it is an instance of.

type Anatomy = Record<string, AnatomyElement>;

AnatomyElement

PropertyTypeRequiredDescription
typeElementType | ElementTypeRefYesWhat kind of element this is
detectedInstringNoFrame or node name where this element was found
instanceOfstring | SubcomponentRefNoComponent name this element is an instance of, or a $ref to a subcomponent

ElementType

One of 11 string literals:

TypeDescription
textText content
glyphIcon or symbol
vectorVector shape
containerLayout container (frame, group)
slotInsertion point for child content
instanceComponent instance
lineLine element
ellipseEllipse/circle
rectangleRectangle
polygonPolygon
starStar shape

ElementTypeRef

A URI reference to an externally defined element type:

type ElementTypeRef = { $ref: string };
// e.g. { $ref: "foundations#/definitions/glyph" }

SubcomponentRef

A JSON Pointer linking to a subcomponent defined in the same spec:

type SubcomponentRef = { $ref: string };
// e.g. { $ref: "#/subcomponents/formLabel" }

Within variants, each element’s runtime properties (children, styles, content) are described by the Element type. The element tree can also be expressed as a recursive Layout.

Further Reading