awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
matthewhudson avatar

matthewhudson/current-device

0
View on GitHub↗
3,934 stars·575 forks·TypeScript·MIT·9 viewsmatthewhudson.github.io/current-device↗

Current Device

current-device is a JavaScript device detection library used to identify operating systems, device categories, and screen orientations within a web browser environment. It serves as a browser environment detector and client-side mapper that translates browser metadata and user-agent strings into predefined device labels and hardware categories.

The library provides tools for executing specific JavaScript logic based on the detected mobile or desktop platform. It also functions as a conditional styling tool and document body class injector, applying descriptive HTML classes to enable device-specific visual styling.

The system includes a screen orientation monitor to detect and react to changes between portrait and landscape modes in real time. It covers general capabilities for user-agent parsing, cross-platform web adaptation, and responsive orientation handling.

Features

  • User Environment Detectors - A system for executing specific JavaScript logic based on the user's current mobile or desktop platform.
  • Client Device Detection - Implements a client-side library to identify device types and operating systems for delivering optimized web experiences.
  • Device and OS Detectors - Identifies the operating system, device category, and screen orientation to trigger logic specific to the user's environment.
  • Device-Conditional Logic - Triggers specific JavaScript actions based on the detected device type, operating system, or current screen orientation.
  • Environment-Specific Execution - Uses JavaScript logic to determine hardware characteristics and execute environment-specific code paths.
  • Execution Path Detection - Detects the runtime environment to trigger specific JavaScript code execution paths based on the user platform.
  • String Parsing - Extracts device and operating system information by analyzing the browser identification string.
  • User-Agent Pattern Matching - Extracts operating system and device categories by matching browser identification strings against predefined regex patterns.
  • Device Detection Utilities - Adds descriptive CSS classes to HTML elements based on the user's operating system, device type, and screen orientation.
  • Screen Orientation Detection - Includes a real-time monitor to detect and react to changes between portrait and landscape screen orientations.
  • Browser Environment Mapping - Maps raw browser metadata to a set of device categories and operating system labels during runtime.
  • Client-Side Environment Mapping - Maps browser metadata and user-agent strings to predefined device labels and hardware categories.
  • User Agent Parsers - Extracts device and operating system information from browser metadata to categorize the user's environment.
  • Conditional CSS Styling - Provides the ability to apply specific CSS styles based on the detected hardware and operating system.
  • CSS Class Utilities - Ships a utility that dynamically injects CSS classes into the document body based on device detection.
  • Device-Specific Styling - Applies different CSS rules based on the user's operating system, device type, or screen orientation for a tailored visual experience.
  • Orientation Change Listeners - Listens for window resize or orientation change events to trigger immediate updates to the environment state.
  • Layout Orientation Recalculation - Executes custom code or updates layouts in real time when a device switches between portrait and landscape viewing modes.
  • State-Based CSS Toggling - Dynamically modifies HTML element classes to adapt layouts for portrait versus landscape viewing modes.
  • CSS Class-Based Styling - Adds descriptive CSS classes to HTML elements based on the detected device and orientation for custom styling.
  • Environment Class Injection - Applies descriptive identifiers to the document body to allow for device-specific CSS targeting.
  • Cross-Platform Web Frameworks - Tailors a website's behavior and appearance to match the specific constraints of different mobile and desktop platforms.
  • Orientation Change Callbacks - Executes a callback function immediately whenever the device switches between landscape and portrait viewing modes.

Star history

Star history chart for matthewhudson/current-deviceStar history chart for matthewhudson/current-device

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Current Device

These projects share indexed features with Current Device. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • arasatasaygin/is.jsarasatasaygin avatar

    arasatasaygin/is.js

    9,078View on GitHub↗

    is.js is a JavaScript validation library and data type checker. It provides a suite of utilities to verify whether variables are primitives, arrays, functions, or specific object types. The project allows for the implementation of custom validation logic and the use of naming namespaces to override default rules and regular expressions. It covers a broad range of validation capabilities, including numeric arithmetic properties, date and time analysis for relative and absolute ranges, and string format verification for patterns such as emails, URLs, and IP addresses. The library also includes

    JavaScript
    View on GitHub↗9,078
  • hgoebl/mobile-detect.jshgoebl avatar

    hgoebl/mobile-detect.js

    4,137View on GitHub↗

    mobile-detect.js is a JavaScript library for user agent detection. It analyzes browser request headers to identify hardware types, operating systems, and browser versions. The library includes a client hardware profiler that assigns performance and capability grades to mobile devices based on their characteristics. It also provides tools to apply specific CSS classes to the document body based on detected hardware to enable responsive styling. The project covers broad analysis capabilities, including the detection of mobile phones, tablets, and desktop computers. It extracts operating system

    JavaScript
    View on GitHub↗4,137
  • jenssegers/agentjenssegers avatar

    jenssegers/agent

    4,813View on GitHub↗

    This project is a PHP user agent parser and mobile device detector. It analyzes HTTP user agent strings to identify the visitor's web browser, operating system, and device type. The library provides a dedicated integration for the Laravel web framework. It distinguishes between mobile phones, tablets, and desktop computers while identifying web robots and the specific names of search engine crawlers. The tool's capabilities include extracting preferred languages from request headers and verifying specific user agent properties. It uses regular expression pattern matching and static data mapp

    PHP
    View on GitHub↗4,813
  • bowser-js/bowserbowser-js avatar

    bowser-js/bowser

    5,739View on GitHub↗

    Bowser is a browser detection library that parses user-agent strings to identify a browser's name, version, rendering engine, and operating system. It functions as a user-agent parser and version constraint checker, extracting structured browser and platform details from raw user-agent strings without external dependencies. The library distinguishes itself by integrating User-Agent Client Hints alongside traditional user-agent data for more accurate browser identification in modern environments. It provides cross-platform browser detection that works consistently across desktop and mobile ope

    JavaScriptbrowserbrowser-detectionbrowser-detector
    View on GitHub↗5,739
Compare all 30 related projects→

Frequently asked questions

What does matthewhudson/current-device do?

current-device is a JavaScript device detection library used to identify operating systems, device categories, and screen orientations within a web browser environment. It serves as a browser environment detector and client-side mapper that translates browser metadata and user-agent strings into predefined device labels and hardware categories.

What are the main features of matthewhudson/current-device?

The main features of matthewhudson/current-device are: User Environment Detectors, Client Device Detection, Device and OS Detectors, Device-Conditional Logic, Environment-Specific Execution, Execution Path Detection, String Parsing, User-Agent Pattern Matching.

Which projects share features with matthewhudson/current-device?

Projects with overlapping indexed features include: arasatasaygin/is.js — is.js is a JavaScript validation library and data type checker. It provides a suite of utilities to verify whether… hgoebl/mobile-detect.js — mobile-detect.js is a JavaScript library for user agent detection. It analyzes browser request headers to identify… jenssegers/agent — This project is a PHP user agent parser and mobile device detector. It analyzes HTTP user agent strings to identify… bowser-js/bowser — Bowser is a browser detection library that parses user-agent strings to identify a browser's name, version, rendering… fomantic/fomantic-ui — Fomantic-UI is a component-based CSS library and frontend design system used to build consistent, responsive user… dodyg/practical-aspnetcore — This project is a comprehensive sample library and implementation guide for ASP.NET Core. It provides a collection of…