A machine-readable guide to this site for AI agents and language models is available at/llms.txt(https://dev.acquia.com/llms.txt on the production site).
*.component.yml file for an enabled module or theme. The components are placed in the “component” subfolder shipped with the module or theme.*.component.yml file, Drupal identifies what this component is called, where the assets are located, and how the block can be configured. The module creates a library definition for each component, loads any other library dependencies, and renders the default html to the page.Acquia created a custom module ‘acquia_cms_component’ that showcases how to create JS components using the Component module.
The following is the directory structure of the Drupal Starter Kits Component module:
| Directory | Description |
|---|---|
components | Contains files related to a JS component. |
block | Contains the
|
libraries | Contains the following subfolders:
|
All other files such as composer.json, LICENSE.txt, README.md, and CONTRIBUTING.md are the standard Drupal module files.
The components directory of a module or theme contains the YAML file. To create the *.components.yml file, you don’t need to know Drupal or PHP coding. However, you must be familiar with Symfony YAML coding.
The following is the file structure of the react_component_block.component.yml file:
| Field | Description |
|---|---|
| name | The label of the component. |
| description | The description of the component. |
| type | The type of the component. For example, block, library, or plugin. |
| css | The relative location of CSS file(s). |
| js | The relative location of JS files(s). |
| template | The relative location of markup. |
| dependencies | Any other components or libraries that should also be loaded. |
| form_configuration | The user input form to collect and pass data to the component. |
To use the Drupal Starter Kits Component module, you must first install it by using one of the following methods:
composer.json file.composer require drupal/acquia_cms_component:^1.0 command to fetch the module.To use the module:
Click Structure > Block layout.
The system displays the Block layout page.
Search for the JS component block. For example:
The system displays the block available to be placed.
Click Place block.
The system displays the Configure block dialog box:
You can add your own JS components and libraries to the codebase, and allow site builders to configure and place those components like any other block in the system.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.