Button as an <a> element
When appropriate, an <a>
element can use the button style. For example, the button helps to navigate to another page.
Important Notes:
If a button serves navigational purpose, the proper URL must be set with the href
attribute.
This example button looks like a visual button but semantically is an anchor.
Demo
Example Button
Twig
{% include '@bolt-elements-button/button.twig' with {
content: 'This looks like a button but semantically is an anchor',
attributes: {
href: 'https://google.com',
}
} only %}
HTML
<a href="https://google.com" class="e-bolt-button">This looks like a button but semantically is an anchor</a>