encore-device-detector
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

Encore device detector

Provide methods to identify device type and set specific CSS class.

Install

$ npm install encore-device-detector

Usage

  1. Import DeviceDetector class
  2. Create an instance and use it

Documentation

Library allows us to detect several device types: - mobile - tablet - desktop - ios It also allows us to detect some specific browsers: - ie - edge - safari And detect orientation: - portrait - landscape

Methods

setDeviceRelatedClassnames - Check device and browser and add specific CSS classes (available options: encore-mobile, encore-tablet, encore-desktop, encore-ie, encore-edge, encore-safari). Classes are configurable and can be changed using classNameConfiguration parameter isTablet - Check if device is tablet isMobile - Check if device is mobile isDesktop - Check if device is desktop isIE - Check if browser is IE isEdge - Check if browser is Edge isSafari - Check if browser is Safari isPortrait - Check if portrait orientation isLandscape - Check if landscape orientation

Readme

Keywords

none

Package Sidebar

Install

npm i encore-device-detector

Weekly Downloads

5

Version

1.4.0

License

none

Unpacked Size

50.1 kB

Total Files

6

Last publish

Collaborators

  • joaquinvolpe
  • dpiletski
  • shivalijindal
  • xiaottg
  • leonardo.moreno
  • galvogalvo
  • chasenyc
  • davidbrewer
  • paulrumyantsevitr
  • a.bobrovnik
  • yuriyibc
  • ipanfilenko