Layout

API for layout

API reference for Angular CDK layout

import {LayoutModule} from '@angular/cdk/layout';

Utility for checking the matching state of @media queries.

Methods
isMatched

Whether one or more media queries match the current viewport size.

Parameters

value

string | string[]

One or more media queries to check.

Returns
boolean

Whether any of the media queries match.

observe

Gets an observable of results for the given queries that will emit new results for any changes in matching of the given queries.

Parameters

value

string | string[]

One or more media queries to check.

Returns
Observable<BreakpointState>

A stream of matches for the given queries.

A utility for calling matchMedia queries.

Methods
matchMedia

Evaluates the given media query and returns the native MediaQueryList from which results can be retrieved. Confirms the layout engine will trigger for the selector query provided and returns the MediaQueryList for the query provided.

Parameters

query

string

Returns
MediaQueryList

The current state of a layout breakpoint.

Properties
Name Description

breakpoints: { [key: string]: boolean; }

A key boolean pair for each query provided to the observe method, with its current matched state.

matches: boolean

Whether the breakpoint is currently matching.

const Breakpoints: { XSmall: string; Small: string; Medium: string; Large: string; XLarge: string; Handset: string; Tablet: string; Web: string; HandsetPortrait: string; TabletPortrait: string; WebPortrait: string; HandsetLandscape: string; TabletLandscape: string; WebLandscape: string; };