# Rectangle button

This custom block outputs a rectangle button that links to an internal or to an external link, has a predefined style (e.g. blue, white) and can have an icon, as shown below.

Blue rectangle buttons Icon rectangle buttons

# Adding the block to a page

To add a Rectangle button block:

  1. Add or edit a page that uses the Gutenberg editor (e.g. Page or Post)
  2. Click to add a Gutenberg block (more on how to add a Gutenberg block can be found here)
  3. Find the block with the name Rectangle button (highlighted below) and,
  4. Click on it to add it
Add block

# Selecting a predefined style

The Rectangle button block comes with predefined styles that change the colour and the font size of the button to match the Phase 2 designs. To select from one of the predefined styles, simply:

  1. Select the Rectangle button block
  2. Expand the Styles dropdown menu (highlighted below), and
  3. Choose from one of the available styles by clicking on its preview button (highlighted below)
Styles

# Selecting an icon

The Rectangle button can cater for an optional icon that goes above the button text. To add an icon to this block, simply:

  1. Select the Rectangle button block
  2. Expand the Rectangle button settings dropdown menu (highlighted below), and
  3. Choose from one of the available icons by clicking on its preview button (highlighted below)
Icons

Note: Clicking twice on an icon button will remove the selection for that icon.

Finally, the rectangle button block can link to an external or to an internal link. To add a link to this block, simply:

  1. Select the Rectangle button block
  2. Click on the Link icon button (highlighted below)
Link button
  1. Type in the name of the page you're linking to or paste a URL in the field highlighted below
Link
  1. Click on the enter button (highlighted below) to finish editing the link
Submit

Note: You can optionally set the link to open in a new tab by opening the link field, clicking on the expand button and enabling the toggle Open in new tab as highlighted below.

New tab
Last Updated: 7/22/2020, 8:50:23 AM