Menu

A vertical list of interactive list items. This component is usually used inside a popover container to provide additional actions.

Twig Usage
{% set menu_item_one %}
  {% include '@bolt-elements-text-link/text-link.twig' with {
    content: 'Menu Item One',
    attributes: {
      type: 'button',
    }
  } only %}
{% endset %}
{% set menu_item_two %}
  {% include '@bolt-elements-text-link/text-link.twig' with {
    content: 'Menu Item Two',
    attributes: {
      type: 'button',
    }
  } only %}
{% endset %}
{% set menu_item_three %}
  {% include '@bolt-elements-text-link/text-link.twig' with {
    content: 'Menu Item Three',
    attributes: {
      type: 'button',
    }
  } only %}
{% endset %}
{% set list_items %}
  {% include '@bolt-elements-menu/menu-item.twig' with {
    content: menu_item_one,
  } only %}
  {% include '@bolt-elements-menu/menu-item.twig' with {
    content: menu_item_two,
  } only %}
  {% include '@bolt-elements-menu/menu-item.twig' with {
    content: menu_item_three,
  } only %}
{% endset %}

{% include '@bolt-elements-menu/menu.twig' with {
  content: list_items,
} only %}
Schema
Note: when assigning component props as HTML attributes on a web component, make sure to use kebab-case.
Menu (menu.twig)
Prop Name Description Type Default Value Option(s)
attributes

A Drupal-style attributes object with extra attributes to append to this element.

object
content

Menu items. Accepts @bolt-elements-menu/menu-item.twig.

string , array , object
title

The menu element can have a title if needed.

string
spacing

Controls the inset spacing of each menu item.

string small
  • xsmall, small, medium
Menu li (menu-li.twig)
Prop Name Description Type Default Value Option(s)
attributes

A Drupal-style attributes object with extra attributes to append to this element.

object
content

Menu item. It's recommended to use a basic text link here @bolt-elements-text-link/text-link.twig

any
Install Install
npm install @bolt/elements-menu
Dependencies @bolt/core