Skip to main content
Version: 1.x

@microsoft/fast-foundation > MatchMediaBehavior

MatchMediaBehavior class

An abstract behavior to react to media queries. Implementations should implement the constructListener method to perform some action based on media query changes.

Signature:
export declare abstract class MatchMediaBehavior implements Behavior 

Constructors

ConstructorModifiersDescription
(constructor)(query)Constructs a new instance of the MatchMediaBehavior class

Properties

PropertyModifiersTypeDescription
queryMediaQueryListThe media query that the behavior operates on.

Methods

MethodModifiersDescription
bind(source)Binds the behavior to the element.
constructListener(source)Constructs a function that will be invoked with the MediaQueryList context
unbind(source)Unbinds the behavior from the element.