{{ cms_heading(name, { element: '...', value: '...', class: '...' }) }}
ArgumentDescriptionData Type
nameThe element identifierString
element (optional)The HTML element type of the heading (h1, h2, h3, h4, h5, or h6)String
value (optional)The text content to be displayed within the headingString
class (optional)A space-separated list of CSS classes to style the heading componentString

The class variable is only accessible in the code. All other variables are available in the Canopy editor.

Heading component template

<{{ element }} class={{class}}>
  {{ value }}
</{{ element }}>

Rendered HTML output

<h2 class="bg-white">String passed in value</h2>

Example

{{ cms_heading('myheading', { element: 'h3', value: 'Welcome to our page', class: 'text-blue-500 font-bold' }) }}

Was this helpful?

Copyright © 2024 Blutui.