API for toolbar

API reference for Angular Material toolbar

import {MatToolbarModule} from '@angular/material/toolbar';

Selector: mat-toolbar-row

Exported as: matToolbarRow

Selector: mat-toolbar

Exported as: matToolbar
Properties
Name Description
@Input()

color: string | null

Theme color of the toolbar. This API is supported in M2 themes only, it has no effect in M3 themes. For color customization in M3, see https://material.angular.io/components/toolbar/styling.

For information on applying color variants in M3, see https://material.angular.io/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants

API reference for Angular Material toolbar-testing

import {MatToolbarHarness} from '@angular/material/toolbar/testing';

Harness for interacting with a standard mat-toolbar in tests.

Properties
Name Description

static hostSelector: '.mat-toolbar'

Methods
async
getAllChildLoaders
Parameters

selector

S

Returns
Promise<HarnessLoader[]>

async
getAllHarnesses
Parameters

query

HarnessQuery<T>

Returns
Promise<T[]>

async
getChildLoader
Parameters

selector

S

Returns
Promise<HarnessLoader>

async
getHarness
Parameters

query

HarnessQuery<T>

Returns
Promise<T>

async
getHarnessOrNull
Parameters

query

HarnessQuery<T>

Returns
Promise<T | null>

async
getRowsAsText

Gets the text of each row in the toolbar.

Returns
Promise<string[]>

async
hasHarness
Parameters

query

HarnessQuery<T>

Returns
Promise<boolean>

async
hasMultipleRows

Whether the toolbar has multiple rows.

Returns
Promise<boolean>

async
host

Gets a Promise for the TestElement representing the host element of the component.

Returns
Promise<TestElement>

static
with

Gets a HarnessPredicate that can be used to search for a MatToolbarHarness that meets certain criteria.

Parameters

options

ToolbarHarnessFilters = {}

Options for filtering which card instances are considered a match.

Returns
HarnessPredicate<MatToolbarHarness>

a HarnessPredicate configured with the given options.

A set of criteria that can be used to filter a list of MatToolbarHarness instances.

Properties
Name Description

text: string | RegExp

Only find instances whose text matches the given value.

Azure & Blue theme selected.