Title: ResizableBox
Published: March 9, 2021
Last modified: November 7, 2026

---

# ResizableBox

## In this article

 * [Usage](https://developer.wordpress.org/block-editor/reference-guides/components/resizable-box/?output_format=md#usage)
    - [Props](https://developer.wordpress.org/block-editor/reference-guides/components/resizable-box/?output_format=md#props)

ResizableBox is a wrapper around the [re-resizable package](https://github.com/bokuweb/re-resizable)
with pre-defined classes and styles.

## 󠀁[Usage](https://developer.wordpress.org/block-editor/reference-guides/components/resizable-box/?output_format=md#usage)󠁿

Most options are passed directly through to [re-resizable](https://github.com/bokuweb/re-resizable)
so you may wish to refer to their documentation. The primary differences in this
component are that we set `handleClasses` (to use custom class names) and pass some
null values to `handleStyles` (to unset some inline styles).

When you pass `size`, include every dimension that can be resized. When a resize
ends, a dimension missing from `size` is reset to `auto` instead of keeping its 
resized value.

The example below shows how you might use `ResizableBox` to set a width and height
inside a block’s `edit` component.

    ```language-jsx
    import { ResizableBox } from '@wordpress/components';

    const Edit = ( props ) => {
        const {
            attributes: { height, width },
            setAttributes,
            toggleSelection,
        } = props;

        return (
            <ResizableBox
                size={ {
                    height,
                    width,
                } }
                minHeight="50"
                minWidth="50"
                enable={ {
                    top: false,
                    right: true,
                    bottom: true,
                    left: false,
                    topRight: false,
                    bottomRight: true,
                    bottomLeft: false,
                    topLeft: false,
                } }
                onResizeStop={ ( event, direction, elt, delta ) => {
                    setAttributes( {
                        height: height + delta.height,
                        width: width + delta.width,
                    } );
                    toggleSelection( true );
                } }
                onResizeStart={ () => {
                    toggleSelection( false );
                } }
            />
        );
    };
    ```

### 󠀁[Props](https://developer.wordpress.org/block-editor/reference-guides/components/resizable-box/?output_format=md#props)󠁿

  |  Name |  Type |  Default |  Description |  
   |  `showHandle` |  `bool` |  `false` |  Determines of the resize handles are visible. |

For additional props, check out [re-resizable](https://github.com/bokuweb/re-resizable#props).

First published

March 9, 2021

Last updated

November 7, 2026

Edit article

[ Improve it on GitHub: ResizableBox ](https://github.com/WordPress/gutenberg/edit/trunk/packages/components/src/resizable-box/README.md)

[  Previous: RangeControl](https://developer.wordpress.org/block-editor/reference-guides/components/range-control/)

[  Next: ResizeTooltip](https://developer.wordpress.org/block-editor/reference-guides/components/resize-tooltip/)