diff --git a/packages/block-library/src/separator/block.json b/packages/block-library/src/separator/block.json
index 98bcbb9150609..edbfed0b62402 100644
--- a/packages/block-library/src/separator/block.json
+++ b/packages/block-library/src/separator/block.json
@@ -7,6 +7,9 @@
},
"customColor": {
"type": "string"
+ },
+ "width": {
+ "type": "number"
}
}
}
diff --git a/packages/block-library/src/separator/edit.js b/packages/block-library/src/separator/edit.js
index 050bd7423fb66..b3016f7fd93c9 100644
--- a/packages/block-library/src/separator/edit.js
+++ b/packages/block-library/src/separator/edit.js
@@ -7,14 +7,15 @@ import classnames from 'classnames';
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
-import { HorizontalRule } from '@wordpress/components';
+import { HorizontalRule, RangeControl, PanelBody } from '@wordpress/components';
import {
InspectorControls,
withColors,
PanelColorSettings,
} from '@wordpress/block-editor';
-function SeparatorEdit( { color, setColor, className } ) {
+function SeparatorEdit( { color, setColor, className, attributes, setAttributes } ) {
+ const { width = 25 } = attributes;
return (
<>
+
+ {
+ setAttributes( { width: nextWidth } );
+ } }
+ min={ 1 }
+ max={ 100 }
+ required
+ allowReset
+ />
+