Skip to content

LinkControl

Junaid Bhura edited this page Sep 11, 2021 · 2 revisions

link-control

Usage

import { LinkControl } = gumponents.components;

...

attributes: {
	link: {
		type: 'object',
		default: {},
	},
},

...

<LinkControl
	label="Select URL"
	value={ attributes.link }
	onChange={ ( link ) => setAttributes( { link } ) }
	help="Enter a URL."
/>

Props

label

The label for the control.

  • Type: String
  • Required: No

help

The help text for the control.

  • Type: String
  • Required: No

value

The link object value for this control.

  • Type: Object
  • Required: Yes

onChange

A function that receives the link object value of the control.

  • Type: Function
  • Required: Yes

modalTitle

Change the title of the URL modal.

  • Type: String
  • Required: no
  • Default: URL