Skip to content

Conversation

juliendargelos
Copy link

In the "Components" section of the configuration documentation, it is made clear that the name key is not meant to be defined directly from components:

The keys used to define a component are the same as those used for Fields, except the name key.

The keys used to define a component are the same as those used for [Fields](#fields), **except** the `name` key (which is defined by the key in the `components` object).

And indeed, it is not possible to define a field with just a component key, so trying to inherit the name that would have been defined by the component itself throws an error in the cms. The fact that the name key is always required for all fields is also made clear in the "Fields" section:

Key Type Description
name string Required and must be unique across the content array.

| **`name`** | `string` | **Required and must be unique across the content array**. Machine name for the content entry. |

But the description about the component key is misleading as it implies that the name key can be inherited from components:

Key Type Description
component string [...] Properties defined directly on the field (like name, label, required) will override those inherited from the component. [...]

| **`component`** | `string` | Allows a field to inherit its properties (like `type`, `label`, nested `fields`, `options`, etc.) from a defined [Component](#components). The value should be the name (key) of the component to inherit from. Properties defined directly on the field (like `name`, `label`, `required`) will override those inherited from the component. The `type` inherited from the component takes precedence over any `type` defined on the field itself. |

@juliendargelos juliendargelos changed the title Fix inconsistent component field documentation about the name key Fix misleading component field documentation about the name key Jun 15, 2025
@juliendargelos juliendargelos changed the title Fix misleading component field documentation about the name key Fix misleading component key documentation about the name key being inheritable Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant