Search code examples
wordpresswordpress-gutenberg

How to enable DImension Control Gutenberg?


https://developer.wordpress.org/block-editor/reference-guides/components/dimension-control/ Docs says that DimensionControl is used by wp.blockEditor. But I haven't DimensionControl in wp.blockEditor or wp.components or wp.element. Is this Component enabled by default or is needed to be enabled manually?enter image description here


Solution

  • The dimension control component is now inside the @wordpress-components library or package.

    // https://github.com/WordPress/gutenberg/tree/trunk/packages/components/src

    You might be able to import it like this.

    import { DimensionControl } from '@wordpress/components';
    

    Or

    import { __experimentalDimensionControl } from '@wordpress/components';
    

    And apparently it is not stable yet, so you may want to wait before actually using it on production.