Title: Block Types Data
Published: March 9, 2021
Last modified: October 9, 2026

---

# Block Types Data

## In this article

 * [Selectors](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#selectors)
    - [getActiveBlockVariation](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getactiveblockvariation)
    - [getBlockStyles](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblockstyles)
    - [getBlockSupport](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblocksupport)
    - [getBlockType](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblocktype)
    - [getBlockTypes](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblocktypes)
    - [getBlockVariations](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblockvariations)
    - [getCategories](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getcategories)
    - [getChildBlockNames](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getchildblocknames)
    - [getCollections](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getcollections)
    - [getDefaultBlockName](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getdefaultblockname)
    - [getDefaultBlockVariation](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getdefaultblockvariation)
    - [getFreeformFallbackBlockName](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getfreeformfallbackblockname)
    - [getGroupingBlockName](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getgroupingblockname)
    - [getUnregisteredFallbackBlockName](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getunregisteredfallbackblockname)
    - [hasBlockSupport](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#hasblocksupport)
    - [hasChildBlocks](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#haschildblocks)
    - [hasChildBlocksWithInserterSupport](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#haschildblockswithinsertersupport)
    - [isMatchingSearchTerm](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#ismatchingsearchterm)
 * [Actions](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#actions)
    - [reapplyBlockTypeFilters](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#reapplyblocktypefilters)

[ Back to top](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#wp--skip-link--target)

Namespace: `core/blocks`.

## 󠀁[Selectors](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#selectors)󠁿

### 󠀁[getActiveBlockVariation](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getactiveblockvariation)󠁿

Returns the active block variation for a given block based on its attributes. Variations
are determined by their `isActive` property. Which is either an array of block attribute
keys or a function.

In case of an array of block attribute keys, the `attributes` are compared to the
variation’s attributes using strict equality check.

In case of function type, the function should accept a block’s attributes and the
variation’s attributes and determines if a variation is active. A function that 
accepts a block’s attributes and the variation’s attributes and determines if a 
variation is active.

_Usage_

    ```javascript
    import { __ } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { store as blockEditorStore } from '@wordpress/block-editor';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        // This example assumes that a core/embed block is the first block in the Block Editor.
        const activeBlockVariation = useSelect( ( select ) => {
            // Retrieve the list of blocks.
            const [ firstBlock ] = select( blockEditorStore ).getBlocks();

            // Return the active block variation for the first block.
            return select( blocksStore ).getActiveBlockVariation(
                firstBlock.name,
                firstBlock.attributes
            );
        }, [] );

        return activeBlockVariation && activeBlockVariation.name === 'spotify' ? (
            <p>{ __( 'Spotify variation' ) }</p>
        ) : (
            <p>{ __( 'Other variation' ) }</p>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _blockName_ `string`: Name of block (example: “core/columns”).
 * _attributes_ `Record< string, unknown >`: Block attributes used to determine 
   active variation.
 * _scope_ `BlockVariationScope`: Block variation scope name.
 * _innerContent_ `Array< string | null >`: Block inner content used to determine
   the active variation for blocks (such as the Custom HTML block) whose variations
   declare static inner content.

_Returns_

 * `BlockVariation | undefined`: Active block variation.

### 󠀁[getBlockStyles](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblockstyles)󠁿

Returns block styles by block name.

_Usage_

    ```javascript
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const buttonBlockStyles = useSelect(
            ( select ) => select( blocksStore ).getBlockStyles( 'core/button' ),
            []
        );

        return (
            <ul>
                { buttonBlockStyles &&
                    buttonBlockStyles.map( ( style ) => (
                        <li key={ style.name }>{ style.label }</li>
                    ) ) }
            </ul>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _name_ `string`: Block type name.

_Returns_

 * `BlockStyle[]`: Block Styles.

### 󠀁[getBlockSupport](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblocksupport)󠁿

Returns the block support value for a feature, if defined.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const paragraphBlockSupportValue = useSelect(
            ( select ) =>
                select( blocksStore ).getBlockSupport( 'core/paragraph', 'anchor' ),
            []
        );

        return (
            <p>
                { sprintf(
                    __( 'core/paragraph supports.anchor value: %s' ),
                    paragraphBlockSupportValue
                ) }
            </p>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _nameOrType_ `string | BlockType`: Block name or type object
 * _feature_ `string | string[]`: Feature to retrieve
 * _defaultSupports_ `unknown`: Default value to return if not explicitly defined

_Returns_

 * `unknown`: Block support value

### 󠀁[getBlockType](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblocktype)󠁿

Returns a block type by name.

_Usage_

    ```javascript
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const paragraphBlock = useSelect(
            ( select ) => ( select ) =>
                select( blocksStore ).getBlockType( 'core/paragraph' ),
            []
        );

        return (
            <ul>
                { paragraphBlock &&
                    Object.entries( paragraphBlock.supports ).map(
                        ( blockSupportsEntry ) => {
                            const [ propertyName, value ] = blockSupportsEntry;
                            return (
                                <li
                                    key={ propertyName }
                                >{ `${ propertyName } : ${ value }` }</li>
                            );
                        }
                    ) }
            </ul>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _name_ `string`: Block type name.

_Returns_

 * `BlockType | undefined`: Block Type.

### 󠀁[getBlockTypes](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblocktypes)󠁿

Returns all the available block types.

_Usage_

    ```javascript
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const blockTypes = useSelect(
            ( select ) => select( blocksStore ).getBlockTypes(),
            []
        );

        return (
            <ul>
                { blockTypes.map( ( block ) => (
                    <li key={ block.name }>{ block.title }</li>
                ) ) }
            </ul>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.

_Returns_

 * `BlockType[]`: Block Types.

### 󠀁[getBlockVariations](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getblockvariations)󠁿

Returns block variations by block name.

_Usage_

    ```javascript
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const socialLinkVariations = useSelect(
            ( select ) =>
                select( blocksStore ).getBlockVariations( 'core/social-link' ),
            []
        );

        return (
            <ul>
                { socialLinkVariations &&
                    socialLinkVariations.map( ( variation ) => (
                        <li key={ variation.name }>{ variation.title }</li>
                    ) ) }
            </ul>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _blockName_ `string`: Block type name.
 * _scope_ `BlockVariationScope`: Block variation scope name.

_Returns_

 * `BlockVariation[] | undefined`: Block variations.

### 󠀁[getCategories](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getcategories)󠁿

Returns all the available block categories.

_Usage_

    ```javascript
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const blockCategories = useSelect(
            ( select ) => select( blocksStore ).getCategories(),
            []
        );

        return (
            <ul>
                { blockCategories.map( ( category ) => (
                    <li key={ category.slug }>{ category.title }</li>
                ) ) }
            </ul>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.

_Returns_

 * `BlockCategory[]`: Categories list.

### 󠀁[getChildBlockNames](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getchildblocknames)󠁿

Returns an array with the child blocks of a given block.

_Usage_

    ```javascript
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const childBlockNames = useSelect(
            ( select ) =>
                select( blocksStore ).getChildBlockNames( 'core/navigation' ),
            []
        );

        return (
            <ul>
                { childBlockNames &&
                    childBlockNames.map( ( child ) => (
                        <li key={ child }>{ child }</li>
                    ) ) }
            </ul>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _blockName_ `string`: Block type name.

_Returns_

 * `string[]`: Array of child block names.

### 󠀁[getCollections](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getcollections)󠁿

Returns all the available collections.

_Usage_

    ```javascript
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const blockCollections = useSelect(
            ( select ) => select( blocksStore ).getCollections(),
            []
        );

        return (
            <ul>
                { Object.values( blockCollections ).length > 0 &&
                    Object.values( blockCollections ).map( ( collection ) => (
                        <li key={ collection.title }>{ collection.title }</li>
                    ) ) }
            </ul>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.

_Returns_

 * `Record< string, BlockCollection >`: Collections list.

### 󠀁[getDefaultBlockName](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getdefaultblockname)󠁿

Returns the name of the default block name.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const defaultBlockName = useSelect(
            ( select ) => select( blocksStore ).getDefaultBlockName(),
            []
        );

        return (
            defaultBlockName && (
                <p>
                    { sprintf( __( 'Default block name: %s' ), defaultBlockName ) }
                </p>
            )
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.

_Returns_

 * `string | null`: Default block name.

### 󠀁[getDefaultBlockVariation](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getdefaultblockvariation)󠁿

Returns the default block variation for the given block type. When there are multiple
variations annotated as the default one, the last added item is picked. This simplifies
registering overrides. When there is no default variation set, it returns the first
item.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const defaultEmbedBlockVariation = useSelect(
            ( select ) =>
                select( blocksStore ).getDefaultBlockVariation( 'core/embed' ),
            []
        );

        return (
            defaultEmbedBlockVariation && (
                <p>
                    { sprintf(
                        __( 'core/embed default variation: %s' ),
                        defaultEmbedBlockVariation.title
                    ) }
                </p>
            )
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _blockName_ `string`: Block type name.
 * _scope_ `BlockVariationScope`: Block variation scope name.

_Returns_

 * `BlockVariation | undefined`: The default block variation.

### 󠀁[getFreeformFallbackBlockName](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getfreeformfallbackblockname)󠁿

Returns the name of the block for handling non-block content.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const freeformFallbackBlockName = useSelect(
            ( select ) => select( blocksStore ).getFreeformFallbackBlockName(),
            []
        );

        return (
            freeformFallbackBlockName && (
                <p>
                    { sprintf(
                        __( 'Freeform fallback block name: %s' ),
                        freeformFallbackBlockName
                    ) }
                </p>
            )
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.

_Returns_

 * `string | null`: Name of the block for handling non-block content.

### 󠀁[getGroupingBlockName](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getgroupingblockname)󠁿

Returns the name of the block for handling the grouping of blocks.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const groupingBlockName = useSelect(
            ( select ) => select( blocksStore ).getGroupingBlockName(),
            []
        );

        return (
            groupingBlockName && (
                <p>
                    { sprintf(
                        __( 'Default grouping block name: %s' ),
                        groupingBlockName
                    ) }
                </p>
            )
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.

_Returns_

 * `string | null`: Name of the block for handling the grouping of blocks.

### 󠀁[getUnregisteredFallbackBlockName](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#getunregisteredfallbackblockname)󠁿

Returns the name of the block for handling unregistered blocks.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const unregisteredFallbackBlockName = useSelect(
            ( select ) => select( blocksStore ).getUnregisteredFallbackBlockName(),
            []
        );

        return (
            unregisteredFallbackBlockName && (
                <p>
                    { sprintf(
                        __( 'Unregistered fallback block name: %s' ),
                        unregisteredFallbackBlockName
                    ) }
                </p>
            )
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.

_Returns_

 * `string | null`: Name of the block for handling unregistered blocks.

### 󠀁[hasBlockSupport](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#hasblocksupport)󠁿

Returns true if the block defines support for a feature, or false otherwise.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const paragraphBlockSupportClassName = useSelect( ( select ) =>
            select( blocksStore ).hasBlockSupport( 'core/paragraph', 'className' ),
            []
        );

        return (
            <p>
                { sprintf(
                    __( 'core/paragraph supports custom class name?: %s' ),
                    paragraphBlockSupportClassName
                ) }
            /p>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _nameOrType_ `string | BlockType`: Block name or type object.
 * _feature_ `string | string[]`: Feature to test.
 * _defaultSupports_ `unknown`: Whether feature is supported by default if not explicitly
   defined.

_Returns_

 * `boolean`: Whether block supports feature.

### 󠀁[hasChildBlocks](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#haschildblocks)󠁿

Returns a boolean indicating if a block has child blocks or not.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const navigationBlockHasChildBlocks = useSelect(
            ( select ) => select( blocksStore ).hasChildBlocks( 'core/navigation' ),
            []
        );

        return (
            <p>
                { sprintf(
                    __( 'core/navigation has child blocks: %s' ),
                    navigationBlockHasChildBlocks
                ) }
            </p>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _blockName_ `string`: Block type name.

_Returns_

 * `boolean`: True if a block contains child blocks and false otherwise.

### 󠀁[hasChildBlocksWithInserterSupport](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#haschildblockswithinsertersupport)󠁿

Returns a boolean indicating if a block has at least one child block with inserter
support.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const navigationBlockHasChildBlocksWithInserterSupport = useSelect(
            ( select ) =>
                select( blocksStore ).hasChildBlocksWithInserterSupport(
                    'core/navigation'
                ),
            []
        );

        return (
            <p>
                { sprintf(
                    __(
                        'core/navigation has child blocks with inserter support: %s'
                    ),
                    navigationBlockHasChildBlocksWithInserterSupport
                ) }
            </p>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Data state.
 * _blockName_ `string`: Block type name.

_Returns_

 * `boolean`: True if a block contains at least one child blocks with inserter support
   and false otherwise.

### 󠀁[isMatchingSearchTerm](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#ismatchingsearchterm)󠁿

Returns true if the block type by the given name or object value matches a search
term, or false otherwise.

_Usage_

    ```javascript
    import { __, sprintf } from '@wordpress/i18n';
    import { store as blocksStore } from '@wordpress/blocks';
    import { useSelect } from '@wordpress/data';

    const ExampleComponent = () => {
        const termFound = useSelect(
            ( select ) =>
                select( blocksStore ).isMatchingSearchTerm(
                    'core/navigation',
                    'theme'
                ),
            []
        );

        return (
            <p>
                { sprintf(
                    __(
                        'Search term was found in the title, keywords, category or description in block.json: %s'
                    ),
                    termFound
                ) }
            </p>
        );
    };
    ```

_Parameters_

 * _state_ `BlockStoreState`: Blocks state.
 * _nameOrType_ `string | BlockType`: Block name or type object.
 * _searchTerm_ `string`: Search term by which to filter.

_Returns_

 * `boolean`: Whether block type matches search term.

## 󠀁[Actions](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#actions)󠁿

The actions in this package shouldn’t be used directly. Instead, use the functions
listed in the public API [here](https://developer.wordpress.org/block-editor/reference-guide/packages/packages-blocks/)

### 󠀁[reapplyBlockTypeFilters](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-blocks/?output_format=md#reapplyblocktypefilters)󠁿

Signals that all block types should be computed again. It uses stored unprocessed
block types and all the most recent list of registered filters.

It addresses the issue where third party block filters get registered after third
party blocks. A sample sequence: 1. Filter A. 2. Block B. 3. Block C. 4. Filter 
D. 5. Filter E. 6. Block F. 7. Filter G. In this scenario some filters would not
get applied for all blocks because they are registered too late.

First published

March 9, 2021

Last updated

October 9, 2026

Edit article

[ Improve it on GitHub: Block Types Data ](https://github.com/WordPress/gutenberg/edit/trunk/docs/reference-guides/data/data-core-blocks.md)

[  Previous: The Block Editor’s Data](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-block-editor/)

[  Next: The Commands Data](https://developer.wordpress.org/block-editor/reference-guides/data/data-core-commands/)