Change record status: 
Project: 
Introduced in branch: 
12.0.x
Introduced in version: 
12.0.0
Description: 

Drupal core now lets SDC authors declare expectations and cardinality on slots in their component's *.component.yml metadata. You can specify which components (by ID or tag) a slot expects to receive via the new expected property, and constrain how many items a slot accepts with minItems and maxItems. Components can also declare tags at the top level, so a slot can reference a family of components by tag rather than listing each one individually.

For example, an accordion_group component can require that its default slot only accepts accordion_item components, and that at least one is present:

  # accordion_group.component.yml                                               
  name: Accordion Group                                                         
  tags:
    - accordion                                                                 
  slots:                                                                      
    default:                                                                    
      title: Accordion Items
      expected:                                                                 
        - my_theme:accordion_item                                             
      minItems: 1                                                               
      maxItems: 10         

Note that, although these new properties are supported by the component schema, no page builder (e.g., Canvas) supports them yet.

Impacts: 
Themers