Add a component
Choose a stable component name and generate its source, doc, package export, and integration entry.Pick a component name
Choose a unique PascalCase name, such as AcmeCarousel. The name is the component's public export and CLI identity, so keep it stable. Use displayName when you only want to change the label people read.
- Prefer a name that describes the component's purpose in your product.
- Avoid a Core component name unless you are deliberately replacing that component.
- If replacement is truly required, read
astryx docs cli/integrations/building-blocks/components/replace-a-core-component.
Run the add command
Run integration add component in your package with the name. It writes the component, its doc file, and the public import apps use.
bashnpx astryx integration add component AcmeCarousel
textcomponent contribution added[ok] AcmeCarouselDeclare component root ./components in astryx.integration.mjs.- components/AcmeCarousel.doc.mjs- components/AcmeCarousel.tsx- package.json- astryx.integration.mjs
integration add starts with one source export and one single-component .doc.mjs. Keep that shape for one public component. If the source exposes a family, choose the correct shape in astryx docs cli/integrations/building-blocks/components/describe-the-component.
Add never overwrites a file, and --dry-run shows what it would write. Component commands read Core, so install @astryxdesign/core in the package first (astryx docs cli/integrations/quick-start).