Files
alfresco-ng2-components/docs/core/components/toolbar.component.md
Ehsan Rezaei b7783d2259 AAE-39830 Removing Material components color property (#11865)
* AAE-39830 Removing Material components color property

* AAE-39830 Style with class instead of color

* AAE-39830 Updating header component doc

* AAE-39830 Updating toolbar component doc

* AAE-39830 Removed unused theme variable and updated doc
2026-05-07 14:25:14 +02:00

3.2 KiB

Title, Added, Status, Last reviewed
Title Added Status Last reviewed
Toolbar Component v2.0.0 Active 2018-06-08

Toolbar Component

Simple container for headers, titles, actions and breadcrumbs.

Contents

Basic Usage

<adf-toolbar title="Toolbar">
    <button mat-icon-button>
        <mat-icon>create_new_folder</mat-icon>
    </button>
    <button mat-icon-button>
        <mat-icon>delete</mat-icon>
    </button>
</adf-toolbar>

Transclusions

You can set the title content using an <adf-toolbar-title> element (although you can also set a simple textual title with the title attribute). All other content in the toolbar is free-form but you can use one or more <adf-toolbar-divider> elements between your own elements to add a visual separator. Also, any content following a <div> element with the CSS class adf-toolbar--spacer will be pushed across to the right-hand side of the toolbar:

<adf-toolbar>
    <adf-toolbar-title>
        <adf-breadcrumb ...></adf-breadcrumb>
    </adf-toolbar-title>

    <adf-toolbar-divider></adf-toolbar-divider>

    <button></button>
    <button></button>

    <div class="adf-toolbar--spacer"></div>

    <button></button>
</adf-toolbar>

For example, the image below shows a toolbar with a Breadcrumb component title, and then some buttons pushed to the right by a spacer:

Class members

Properties

Name Type Default value Description
title string "" Toolbar title.

Details

Dropdown menu

The following example shows how to create a dropdown menu. The code is based on the <mat-menu> component from the @angular/material library but you could also use your own custom menu components:

<adf-toolbar title="Toolbar">
    ...

    <button mat-icon-button [matMenuTriggerFor]="menu">
        <mat-icon>more_vert</mat-icon>
    </button>
    <mat-menu #menu="matMenu">
        <button mat-menu-item>
            <mat-icon>dialpad</mat-icon>
            <span>Redial</span>
        </button>
        <button mat-menu-item disabled>
            <mat-icon>voicemail</mat-icon>
            <span>Check voicemail</span>
        </button>
        <button mat-menu-item>
            <mat-icon>notifications_off</mat-icon>
            <span>Disable alerts</span>
        </button>
    </mat-menu>
</adf-toolbar>

With the menu set up like this, you would see the following menu items as defined earlier when you click the menu button:

See also