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.

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.

bash
npx astryx integration add component AcmeCarousel
text
component contribution added
​
[ok] AcmeCarousel
​
Declare 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).