# react-ugent

> A headless React Component to identify browser, device and OS.

Latest version **1.0.1** (published 2018-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-ugent
pnpm add react-ugent
yarn add react-ugent
bun add react-ugent
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-07-17 |
| First published | 2018-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 160.3 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 44 |
| Author | Jake Moxey |
| Maintainers | jmoxey |
| Keywords | react, user, agent, component |

## Links

- npm: https://www.npmjs.com/package/react-ugent
- Repository: https://github.com/medipass/react-ugent
- Homepage: https://github.com/medipass
- Issues: https://github.com/medipass/react-ugent/issues
- npm.io page: https://npm.io/package/react-ugent

## Dependencies (4)

- [idx](https://npm.io/package/idx.md) 2.4.0
- [eslint](https://npm.io/package/eslint.md) 5.1.0
- [ua-parser-js](https://npm.io/package/ua-parser-js.md) 0.7.18
- [@medipass/eslint-config-react-medipass](https://npm.io/package/@medipass/eslint-config-react-medipass.md) 8.3.5

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-07-17
- 1.0.0 — 2018-07-17

## README

# React Ugent

> A headless React Component to identify browser, device and OS. Built with [ua-parser-js](https://github.com/faisalman/ua-parser-js#methods).

## Table of Contents

- [React Ugent](#react-ugent)
  - [Table of Contents](#table-of-contents)
  - [Installation](#installation)
  - [Usage](#usage)
  - [`<Ugent>` Props](#ugent-props)
    - [browser](#browser)
    - [device](#device)
    - [os](#os)
    - [`children` Render Props](#children-render-props)
      - [parsedUserAgent](#parseduseragent)
      - [userAgent](#useragent)
  - [Special Thanks](#special-thanks)
  - [License](#license)

## Installation

```
npm install react-ugent --save
```

or install with [Yarn](https://yarnpkg.com) if you prefer:

```
yarn add react-ugent
```

## Usage

```js
import React from 'react';
import Ugent from 'react-ugent';

export default () => (
  <div>
    <Ugent browser="chrome">
      <div>
        This text only shows on Chrome
      </div>
    </Ugent>
    <Ugent browser="chrome" device="mobile">
      <div>
        This text only shows on Chrome on mobile devices
      </div>
    </Ugent>
    <Ugent browser="safari" os="ios">
      <div>
        This text only shows on Safari on iOS.
      </div>
    </Ugent>
    <Ugent browser="ie" os="windows">
      <div>
        This text only shows on IE on Windows.
      </div>
    </Ugent>
  </div>
);
```

## `<Ugent>` Props

### browser

> `string` | Optional

Render the child for a given browser.

Available browsers are:

```
chrome, chromium, edge, firefox, ie, lynx, safari, opera
```
View all the available browser values [here](https://github.com/faisalman/ua-parser-js#methods)

### device

> `string` | Optional

Render the child for a given device.

Available devices are:

```
console, computer, mobile, tablet, smarttv, wearable, embedded
```

### os

> `string` | Optional

Render the child for a given OS.

Available OS are:

```
android, blackberry, chromium os, debian, ios, linux, mac os, ubuntu, unix, windows
```
View all the available OS values [here](https://github.com/faisalman/ua-parser-js#methods)

### `children` Render Props

#### parsedUserAgent

> `Object({ browser, device, os })`

#### userAgent

> `string`

## Special Thanks

- [ua-parser-js](https://github.com/faisalman/ua-parser-js#methods)

## License

MIT © [Medipass Solutions Pty. Ltd.](https://github.com/medipass)

---
_Source: https://npm.io/package/react-ugent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
