Template doc overview

Understand what the template doc controls, keep it accurate as the UI changes, and check how Astryx lists the template.

Understand the two files

Every template has a source file and a doc file. For acme-dashboard, the source is templates/acme-dashboard.tsx and the doc is templates/acme-dashboard.doc.mjs. Both begin with acme-dashboard, which is how Astryx knows they belong together.

FileWhat it controls
templates/acme-dashboard.tsxThe UI source that an app copies and then owns.
templates/acme-dashboard.doc.mjsHow Astryx names, describes, categorizes, previews, and resolves the template before it is copied.

The integration manifest points Astryx to the templates directory; it does not list each template. Change the source and doc together whenever the purpose, preview, readiness, or replacement behavior changes. No automated check can tell whether the doc still describes the rendered UI.

Document the shared fields

These fields apply to every page and block. The page, block, and replacement guides add the fields unique to each.

FieldTypeRequiredDescription
type'page' | 'block'yesDiscriminant selecting the variant: 'page' for a full page template, 'block' for an editable composition that may be standalone or component-owned.
namestringyesStable identifier for block templates; change displayName, not name, to edit their visible label. For page templates it is a human-readable label, while the existing template-directory/CLI slug owns the default registry path.
displayNamestringyesHuman-readable label for the gallery/CLI. Spaces out block names that mirror a PascalCase component ('ChatMessageMetadata' → 'Chat Message Metadata').
descriptionstringnoOne-sentence description of what the template provides.
isReadybooleannoWhether the template is ready for use. false shows as '(WIP)' in the gallery and CLI.

From TemplateDoc: astryx docs authoring template-doc

Check how Astryx lists it

Read the package-scoped template list after every doc change. Confirm the id, visible name, description, type, readiness, and package.

bash
npx astryx --json template --list --package @acme/astryx-templates
Relevant list result
json
{
"id": "acme-dashboard",
"name": "acme-dashboard",
"displayName": "Acme Dashboard",
"description": "An analytics dashboard for reviewing account health and recent trends.",
"type": "page",
"package": "@acme/astryx-templates",
"isReady": false
}