Dropdown

A responsive menu.

Published Last updated: 4.6.0 Change log Github NPM
Twig Usage
{% embed '@bolt-components-dropdown/dropdown.twig' with {
  title: 'Toggle Menu',
  collapse: true
} %}
  {% block content %}
    {% include '@bolt-components-list/list.twig' with {
      inset: true,
      spacing: 'small',
      items: [
        include('@bolt-elements-text-link/text-link.twig', {
          content: 'Link 1',
          attributes: {
            href: '#!'
          }
        }),
        include('@bolt-elements-text-link/text-link.twig', {
          content: 'Link 2',
          attributes: {
            href: '#!'
          }
        }),
        include('@bolt-elements-text-link/text-link.twig', {
          content: 'Link 3',
          attributes: {
            href: '#!'
          }
        }),
      ]
    } only %}
  {% endblock %}
{% endembed %}
Schema
Note: when assigning component props as HTML attributes on a web component, make sure to use kebab-case.
Prop Name Description Type Default Value Option(s)
title

The toggle title text

string
center

True to center the toggle title

boolean false
collapse

True to hide toggle until mobile screen size

boolean false
content

All of the items in the dropdown -- generally works by including @bolt-components-nav/nav.twig with links array of objects containing text & url

any
Install Install
npm install @bolt/components-dropdown
Dependencies @bolt/components-icon @bolt/core-v3.x @bolt/lazy-queue classnames ev-emitter handorgel