Skip to content

Composition

A Composition is a named, authored unit of composed content. The top-level anatomy + elements + layout triplet is the primary content — there is no wrapper and no reserved main key. An optional slotContent map bundles named slot fills alongside that primary content for authoring convenience.

interface Composition {
title?: string;
description?: string;
anatomy: Anatomy;
elements: Elements;
layout: Layout;
slotContent?: Record<string, SlotContent>;
}
type Compositions = Record<string, Composition>;

Properties

PropertyTypeRequiredDescription
titlestringNoHuman-readable label for the composition
descriptionstringNoPurpose and usage notes for documentation tooling
anatomyAnatomyYesElement type map for the primary content
elementsElementsYesElement-level content, styles, and prop configurations
layoutLayoutYesTree ordering of the primary content
slotContentRecord<string, SlotContent>NoNamed slot fills bundled with this composition

slotContent is an authoring convenience, not a scope boundary — fills there may reference entries in other compositions via SlotContentRef.

Registry and references

Compositions (Record<string, Composition>) is the registry shape used by external composition files, keyed compositions: (system-scoped).

A SlotContentRef pointing at a composition resolves as follows:

PointerResolves to
#/compositions/pageGridthe composition’s top-level anatomy + elements + layout
#/compositions/filterResultsPage/slotContent/pageHeaderthat bundled SlotContent

Further Reading