Skip to content

LinkButton

Junaid Bhura edited this page Sep 11, 2021 · 1 revision

link-button

Usage

import { LinkButton } = gumponents.components;

...

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

...

<LinkButton
	className="btn btn--primary"
	placeholder="Select Link"
	value={ attributes.link }
	onChange={ ( link ) => setAttributes( { link } ) }
/>

Props

value

The link object value for this component.

  • Type: Object
  • Required: Yes

onChange

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

  • Type: Function
  • Required: Yes

className

Custom class for this component.

  • Type: String
  • Required: no
  • Default: wp-block-button

placeholder

Default text when no link has been selected.

  • Type: String
  • Required: no
  • Default: Button

modalTitle

Change the title of the URL modal.

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