How to define a custom menu and show it like an admin menu in Drupal 8?
This is how i add custom menu :

In a custom module : 


  xxxx.module :


/**
 * Implements hook_toolbar().
 */
function xxxx_toolbar() {
    $items = [];

    $items['Boutique'] = [
        '#cache' =&gt; [
            'contexts' =&gt; ['user.permissions'],
        ],
    ];

    if (!\Drupal::currentUser()-&gt;hasPermission('Access the Commande overview page')) {
        return $items;
    }


    $items['Boutique'] += [
        '#type' =&gt; 'toolbar_item',
        '#weight' =&gt; 1,
        'tab' =&gt; [
            '#type' =&gt; 'link',
            '#title' =&gt; 'Boutique',
            '#url' =&gt; \Drupal\Core\Url::fromUri("internal:/admin/boutique/commandes"),
            '#attributes' =&gt; [
                'title' =&gt; 'Boutique menu',
                'class' =&gt; ['toolbar-icon', 'toolbar-icon-boutique'],
            ],
        ],
        'tray' =&gt; [

            'configuration' =&gt; [
                '#type' =&gt; 'link',
                '#title' =&gt; 'Commandes',
                '#url' =&gt; \Drupal\Core\Url::fromUri("internal:/admin/boutique/commandes"),

            ],[
                '#type' =&gt; 'link',
                '#title' =&gt; 'Livraison',
                '#url' =&gt; \Drupal\Core\Url::fromUri("internal:/admin/boutique/livraison"),

            ],
            [
                '#type' =&gt; 'link',
                '#title' =&gt; 'Configuration',
                '#url' =&gt; \Drupal\Core\Url::fromUri("internal:/admin/boutique/configuration"),

            ],

        ],
        '#attached' =&gt; array(
            'library' =&gt; array(
                'boutique/admin',
            ),
        ),

    ];
    return $items;
}


And the result :



You can manage access with :


  if (!\Drupal::currentUser()->hasPermission('Access the Commande
  overview page')) {
          return $items;
      }


in the xxxx.module like me.