matthewhudson/current-device

📱 The easiest way to write conditional CSS and/or JavaScript based on device operating system (iOS, Android, Blackberry, Windows, Firefox OS, MeeGo),...

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 30 minutes ago
Added to GitGenius on September 17th, 2026
Created on September 19th, 2012
Open Issues & Pull Requests: 2 (+0)
GitHub issues: Enabled
Number of forks: 573
Total Stargazers: 3,926 (+0)
Total Subscribers: 117 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 1098.8 days
Mean response time: 1484.8 days
90th percentile: 4001.5 days
Tracked items: 37

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug-major (4)
  • bug-minor (2)
  • documentation (1)
  • internal (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

current-device is a device detection library that adds CSS classes and JavaScript methods to identify the user's device operating system, orientation, and type.

The tool solves the problem of writing device-specific conditional logic without complex user-agent parsing. It works by detecting device characteristics at runtime and injecting CSS classes into the HTML element, while also exposing JavaScript methods for programmatic checks. This approach lets developers target specific devices, orientations, and form factors directly in stylesheets or JavaScript without maintaining fragile detection logic themselves.

The library supports a broad range of devices including iOS, Android, BlackBerry, Windows, macOS, Firefox OS, MeeGo, and AppleTV, detecting both device type (mobile, tablet, desktop, television) and orientation (portrait, landscape). It ships with built-in TypeScript types and can be installed via npm or included directly through a CDN script tag. This makes it suitable for projects that need to adapt layouts or behavior across diverse device ecosystems, particularly those targeting both mobile and desktop users where orientation changes matter.

The project maintains a stable, focused scope with no indication of rapid churn or experimental directions. Development appears steady without signs of abandonment or major architectural upheaval.