Counters introduction

To append a counter to the listitems that have a submenu, use the counters options and configuration.

<script>
    document.addEventListener(
        "DOMContentLoaded", () => {
            new Mmenu( "#menu", {
                counters: {
                    // counters options
                }
            }, {
                counters: {
                    // counters configuration
                }
            });
        }
    );
</script>

Example

Give it a go, change the options below and see how it affects the menu.

  • Append a counter to the listitems.
<script>
    document.addEventListener(
        "DOMContentLoaded", () => {

        }
    );
</script>

Options for the "counters" add-on

Option Datatype Default value Description
counters
{
add Boolean false Whether or not to automatically append a counter to each menu item that has a submenu.
}

Configuration for the "counters" add-on

The "counters" add-on has no configuration options.

CSS variables for the "counters" add-on

Variable Datatype Default value Description
--mm-counter-size CSS number 34px The height of counters.

API methods for the "counters" add-on

The "counters" add-on has no API methods.

Next add-on:
Iconbar