Skip to main content

Header template

Description

The header template is used by the Header Widget.

Control classes

ClassDescriptionRequired
mambo-ctrl-levelIndicates the element where the current level name should be injectedNo
mambo-ctrl-simple-profileWhen clicked, displays the Simple Profile with a summary of the user's primary level and pointsNo

Template data

VariableDescriptionType
userThe user data object containing all basic user information. For complete details, refer to the User API documentationObject
isLoadingFlag indicating whether user data is still loading. If true, the template will re-render once loading completesBoolean
primaryLevelContains progress information for the primary level (defined using levelGroups in widget initialisation). Includes current level, next level, percentage progress and moreArray
pointsList of points unlocked by the current userArray
userNameThe user's name to be displayed, as determined by the Header Widget configurationString

Implementation example

This example shows a basic header template with loading state handling:

JavaScript

Customisation options

Consider these enhancements for your header template:

  • Adding profile images or avatars
  • Including progress bars for level advancement
  • Displaying recent achievements or rewards
  • Adding interactive elements like dropdown menus
  • Implementing responsive design for different screen sizes