Navigation Block
The Navigation Block is a block that allows you to display a navigation menu in your email. It supports several options to help you customize the appearance of your navigation menu.
Options
The Navigation Block supports the following options:
align
: The alignment of the navigation menu. It supports theTAlign
interface.hamburger
: Boolean value indicating whether to display the hamburger menu icon for mobile devices.color
: The color of the navigation menu text.font
: The font settings for the navigation menu. It supports theIFont
interface.lineHeight
: The line height of the navigation menu text. It supports theILineHeight
interface.letterSpacing
: The letter spacing of the navigation menu text.padding
: The padding around the navigation menu. It supports theIPadding
interface.target
: The default link target for navigation menu links.textDecoration
: The text-decoration for navigation menu links. This can beunderline
,overline
, ornone
.elements
: An array of objects representing the individual navigation menu items. Each object has alabel
property for the text and ahref
property for the link URL.
Usage
To use the Navigation Block in your email, you can create a new instance of the NavigationBlock
class and customize
its options. Here’s an example:
In this example, we’ve customized the alignment, hamburger menu display, color, font, line height, letter spacing, padding, link target, text decoration, and navigation menu items of the Navigation Block.
{% hint style=“info” %}
Note: that the label
and href
properties of each element in the elements
array are required.
{% endhint %}