Skip to content

six-header

Header Menu Button

Header Menu button with a text and an icon. Usually used for dropdowns.

App 1 appsApp 1App 2App 3
html
<six-header>
  <six-header-dropdown-item>
    <six-header-menu-button slot="trigger"
      >App 1 <six-icon slot="suffix">apps</six-icon></six-header-menu-button>
    <six-menu>
      <six-menu-item checked>App 1</six-menu-item>
      <six-menu-item>App 2</six-menu-item>
      <six-menu-item>App 3</six-menu-item>
    </six-menu>
  </six-header-dropdown-item>
</six-header>
<script type="module">
  const menuItems = document.querySelectorAll('six-menu-item');
  const headerButton = document.querySelector('six-header-menu-button');

  menuItems.forEach((item) => {
    item.addEventListener('click', () => {
      headerButton.innerText = this.innerText;
      menuItems.forEach((item) => (item.checked = false));
      item.checked = true;
    });
  });
</script>

Properties

PropertyAttributeDescriptionTypeDefault
caretcaretSet to true to draw the button with a caret for use with dropdowns, popovers, etc.booleanfalse
disableddisabledSet to true to disable the button.booleanfalse
loadingloadingSet to true to draw the button in a loading state.booleanfalse
resetresetIndicates if activating the button should reset the form.booleanfalse
submitsubmitIndicates if activating the button should submit the form. Ignored when href is set.booleanfalse

Dependencies

Depends on

Graph


Copyright © 2021-present SIX-Group