diff --git a/packages/block-library/src/video/edit.js b/packages/block-library/src/video/edit.js index 5b54e8ae0f0a4e..175d95871ecbb4 100644 --- a/packages/block-library/src/video/edit.js +++ b/packages/block-library/src/video/edit.js @@ -219,8 +219,10 @@ class VideoEdit extends Component { + + { __( 'Poster Image' ) } + ( + + + Author + + + +); +``` + +### Props + +#### className + +The class that will be added with `components-base-control__label` to the classes of the wrapper div. +If no className is passed only `components-base-control__label` is used. + +- Type: `String` +- Required: No + +#### children + +The content to be displayed within the `BaseControl.VisualLabel`. + +- Type: `Element` +- Required: Yes diff --git a/packages/components/src/base-control/index.js b/packages/components/src/base-control/index.js index 925914b7824154..37a5939e10775c 100644 --- a/packages/components/src/base-control/index.js +++ b/packages/components/src/base-control/index.js @@ -8,7 +8,7 @@ function BaseControl( { id, label, help, className, children } ) {
{ label && id && } - { label && ! id && { label } } + { label && ! id && { label } } { children }
{ !! help &&

{ help }

} @@ -16,4 +16,13 @@ function BaseControl( { id, label, help, className, children } ) { ); } +BaseControl.VisualLabel = ( { className, children } ) => { + className = classnames( 'components-base-control__label', className ); + return ( + + { children } + + ); +}; + export default BaseControl;