-
Notifications
You must be signed in to change notification settings - Fork 20
Link Control
Matthew Haines-Young edited this page Dec 7, 2021
·
7 revisions
These control components are intended for use in the advanced block settings UI that appears in the sidebar.
The link control is just a wrapper for the core Gutenberg URL input component. The only difference is the visual appearance and API is more aligned with other sidebar controls such as the TextControl
.
const { InspectorControls } = wp.blocks;
const { LinkControl } = hm.controls;
const { attributes, setAttributes } = props;
<InspectorControls>
<LinkControl
label="Link"
help="Some description text"
value={ attributes.link }
onChange={ link => setAttributes( { link } ) }
/>
</InspectorControls>