# use-videocard

> A React hook that gathers graphics card information

Latest version **1.1.4** (published 2020-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-videocard
pnpm add use-videocard
yarn add use-videocard
bun add use-videocard
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2020-07-08 |
| First published | 2020-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12.4.0 |
| Dependencies | 0 |
| Unpacked size | 22.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | @mattsmyname, BRA1L0R |
| Maintainers | bra1l0r |
| Keywords | react, gpu, graphics, webgl |

## Links

- npm: https://www.npmjs.com/package/use-videocard
- Repository: https://github.com/BRA1L0R/use-videocard
- Homepage: https://github.com/BRA1L0R/use-videocard#readme
- Issues: https://github.com/BRA1L0R/use-videocard/issues
- npm.io page: https://npm.io/package/use-videocard

## 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.1.4 (latest) — 2020-07-08
- 1.1.3 — 2020-07-08
- 1.1.2 — 2020-07-08
- 1.1.1 — 2020-07-08
- 1.1.0 — 2020-06-29
- 1.0.0 — 2020-06-28
- 0.2.2 — 2020-06-28
- 0.2.1 — 2020-06-28
- 0.2.0 — 2020-06-28
- 0.1.5 — 2020-06-28
- 0.1.4 — 2020-06-27
- 0.1.3 — 2020-06-27
- 0.1.2 — 2020-06-27
- 0.1.1 — 2020-06-27
- 0.1.0 — 2020-06-27

## README

![](assets/logo.svg)

# `use-videocard`
![https://www.npmjs.com/package/use-videocard](https://img.shields.io/npm/v/use-videocard?style=for-the-badge)
![](https://img.shields.io/github/languages/code-size/BRA1L0R/use-videocard?style=for-the-badge)
![https://github.com/BRA1L0R/use-videocard/blob/master/LICENSE.md](https://img.shields.io/github/license/BRA1L0R/use-videocard?style=for-the-badge)
![https://www.npmjs.com/package/use-videocard](https://img.shields.io/npm/dy/use-videocard?style=for-the-badge)

## Installation
This package can be found in the NPM registry, install it using this command:
#### With _npm_:
```
npm install use-videocard
```

#### With _yarn_:
```
yarn add use-videocard
```

## Example
[![Edit sweet-night-sgsyw](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/sweet-night-sgsyw?fontsize=14&hidenavigation=1&theme=dark)
```tsx
import React from 'react'
import useVideoCard from 'use-videocard'

function App() {
  const graphics = useVideoCard()

  return (
    <div className="App">
      <p>Vendor: { graphics?.unmasked.vendor }</p>
      <p>GPU: { graphics?.unmasked.renderer }</p>
    </div>
  );
}
```

## API
### `useVideoCard (gl?: WebGLRenderingContext): GraphicsInformation`
- `gl`: The WebGLRenderingContext which we want to extract the information from. _NOTE: this field is *OPTIONAL*, the hook creates a canvas without appending it to the dom, but if you really want to specify the `WebGLRenderingContext` then set this field_

### `GraphicsInformation`
```ts
interface GraphicsInformation {
    renderer: string,
    vendor: string,
    unmasked: {
        vendor: string,
        renderer: string
    }
}
```

- renderer: The masked renderer ID
- vendor: The masked vendor ID
- unmasked:
  - vendor: The unmasked vendor name. _es: `NVIDIA Corporation`_
  - renderer: The unmasked renderer name (the graphics card model and the pci version). _es: `Geforce GTX 1070/PCIe/SSE2`_

## Contributors
<a href="https://github.com/BRA1L0R"><img style="height:auto;" alt="" src="https://avatars2.githubusercontent.com/u/17928339?s=460&u=f7f92a4673f1286094c282b3ee7b46076527ac72&v=4" width="80" height="80"><a/>
<a href="https://github.com/talentlessguy"><img style="height:auto;" alt="" src="https://avatars3.githubusercontent.com/u/35937217?s=460&amp;u=d8f2691645359f6499cd3ded31b22c202e08d00e&amp;v=4" width="80" height="80"><a/>

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