Block templates allow specifying a default initial state for an editor session, we can set the initial state for a single block or the whole editor.
We can set a default block state dynamically or register a default for a whole post type. Templates can be declared in JS or in PHP as an array of blockTypes (block name and optional attributes). We can also nest blocks here and/or lock the template via the templateLock
property. It's also possible to lock individual parts with the lock
attribute on children.
Note: This is a block template, not to be confused with a block theme template.
We can control the editor content for custom post types. Locking some templated blocks for example on a post type is the new way to give the CPT customizations that previously required a metabox library. Another good place to use this when you may want a “custom block” but can compose it with existing core blocks, it could be saved as a pattern, but can also be saved as a block template - it can then be presented in the inserter as a block.