There is now a new experimental subsystem in core called Layout, in the namespace \Drupal\Core\Layout. This is adapted from the contrib module Layout Plugin, used primarily by Panels and Display Suite.
Plugin discovery of layouts will only occur if the experimental layout_discovery.module
is installed. Modules wishing to extend this API or provide layouts should declare a dependency on layout_discovery
. All of the Layout classes and interfaces are marked as @internal
to denote that there is no promise of backwards-compatibility while they are still under development; however, the end goal is to add these classes as public API. (See the experimental module policy for more information.)
The handbook documentation explains how to interact with this new API.