add component

Learn how to add a component to your project.

This command adds one or more components to your project, regenerating type definitions accordingly.

Usage

This command has the following syntax:

croct add component <components>

Example

Add a component interactively:

npx croct@latest add component

Add a specific component:

npx croct@latest add component my-component

Add multiple components at once:

npx croct@latest add component hero-banner sidebar-cta

Add a component at a specific version:

npx croct@latest add component my-component@2

Arguments

components(optional)
Array<string>

One or more components to add, separated by spaces.

You can specify a version for each component using the @ symbol, for example my-component@2. If omitted, the CLI prompts you to select components interactively.

Options

This command only accepts global options.