1.0.21 • Published 1 year ago

device-detector-for-passes v1.0.21

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

device-detector-for-passes

Usage

import "./App.css";
import {
  detectDevice,
  DetectDeviceComponent,
} from "device-detector-for-passes";

function App() {
  const device = detectDevice(navigator.userAgent);
  console.log({ device });

  return (
    <>
      <DetectDeviceComponent
        size={"200px"}
        isDesktop={"true"}
        link={"https://example.com"}
        lanugage={"german"}
      />
    </>
  );
}

export default App;

Features

  • Detect Device Component : A React component for rendering device-specific content based on the user's device and operating system.
  • Detect Device Function : detectDevice(userAgent: string): { browser: string; result: string } - Detects the user's device and operating system based on the provided userAgent.

Component Paramenter and description

ParamenterMandatoryDescription
sizeyes(type: string): The size of the rendered content. Must be a valid size value (e.g., '100px', '50%', etc.).
languageno(type: string): Specify the language for the rendered content. Supported languages are 'english' and 'german'.
isDesktopno(type: boolean): Specify whether the content is designed for desktop. If true, desktop-specific content will be rendered.
linkno(type: string): The link to be associated with the rendered content.

Function detectDevice

FunctionsDescriptionParametersResponse
detectDeviceThe detectDevice function is designed to analyze a given userAgent string, typically obtained from the navigator.userAgent property in a web browser. The purpose is to determine the user's device and operating system based on the information provided in the userAgent.userAgent: stringAndroid iOS Mac OS Windows Unknown Device/OS
1.0.21

1 year ago

1.0.19

1 year ago

1.0.20

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.11

2 years ago

1.0.15

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago