Component family
Adapt a single-component doc when one module exposes several public components or hooks that belong to one family.Choose the family shape
Start with a complete single-component doc. Convert its top-level props into a components array only when one source module or component directory exposes several public components or hooks as one family. The family doc keeps the shared usage guidance; each array entry owns one public export.
- Put the primary or most-used export first.
- Use a full entry when this file owns that export's description and signature.
- Use
propsfor a component entry. Useparamsandreturnsfor a hook entry. - Do not add private implementation helpers or exports that people should not use directly.
| Field | Type | Required | Description |
|---|---|---|---|
| components | (ComponentEntry | ComponentRef)[] | no | MultiComponentDoc variant (required there): one entry per public component/hook exported from the directory. Each entry is a full ComponentEntry (inline: name, displayName, description, props | params+returns) or a name-only ComponentRef pointing at a sibling {Name}.doc.mjs. |
From ComponentDoc: astryx docs authoring component-doc
Document the family inline
javascript/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */export default {type: 'component',name: 'AcmeTabs',displayName: 'Acme Tabs',import: '@acme/astryx-widgets/components/AcmeTabs',usage: {description:'Switches between related views without leaving the page.',},components: [{name: 'AcmeTabs',displayName: 'Acme Tabs',description: 'Owns selection and lays out the tab list and panels.',props: [{name: 'value',type: 'string',description: 'The selected tab value.',required: true,},],},{name: 'AcmeTab',displayName: 'Acme Tab',description: 'Selects one view in Acme Tabs.',props: [{name: 'value',type: 'string',description: 'The value this tab selects.',required: true,},],},],};
The public module named by import must export every component or hook named by a full entry.
Give a member its own file
When one family member needs its own doc, replace its full entry with {name: 'MemberName'} and move the details into a sibling doc. The parent keeps the family relationship without copying the child's content. Continue with astryx docs cli/integrations/building-blocks/components/describe-the-component/subcomponent.