Skip to content
back

Browser detection

Import Browser from @waaark/luge, register it with luge.addPlugin('browser', Browser), then call luge.init(). See Getting started for a complete setup.

luge includes Bowser to detect browser name and version. The Bowser instance is globally available on luge.browser to do your own checks.

CSS classes

The following CSS classes are added to the html element depending on the user’s browser:

  • is-mobilewhen the user uses a mobile ;
  • is-tablet when the user uses a tablet ;
  • is-handheld when the user uses either a mobile or a tablet ;
  • is-desktop when the user uses a computer ;
  • is-safari when the user uses Safari, plus an is-safari-[version] class containing the detected version number.

Try it

Open the full demo