close

Filter

loading table of contents...

Frontend Developer Manual / Version 2201

Table Of Contents

6.3.2 Device Detector

The device-detector API brick stores device and orientation information to support responsive UIs.

Technical Description

The brick provides methods to read and update device relevant information of pseudo elements at the body defined by CSS media queries.

import { getLastDevice } from "@coremedia/brick-device-detector";
...
  if (getLastDevice().type !== "mobile") {
    $cartPopup.toggleClass("cm-cart-popup--active");
  }
...

Example 6.1.  Shopping Cart Example


Note

Note

Please note that this brick contains JavaScript files, what will automatically be installed, if you add the brick to your theme package.json. See Section 5.3, “Using Bricks” to learn how to install a brick in your theme.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.