# element-is-visible

> Determine whether a DOM element is visible or not, extracted from Selenium

Latest version **1.0.0** (published 2020-10-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install element-is-visible
pnpm add element-is-visible
yarn add element-is-visible
bun add element-is-visible
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-10-02 |
| First published | 2020-09-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 61.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Frontside Engineering |
| Maintainers | frontsidejack |

## Links

- npm: https://www.npmjs.com/package/element-is-visible
- Repository: https://github.com/thefrontside/element-is-visible
- npm.io page: https://npm.io/package/element-is-visible

## Recent versions

- 1.0.0 (latest) — 2020-10-02
- 1.0.0-bad32d9 (mk_release) — 2020-10-02
- 1.0.0-aff6514 — 2020-10-02
- 1.0.0-ca739eb — 2020-09-30

## README

# element-is-visible

Checks whether a DOM element is visible through various heuristics, such as
checking CSS properties, sizing and overflow. The code is extracted from the
[Selenium](https://github.com/SeleniumHQ/selenium) project.

In comparison to other stand-alone libraries which perform this function, the
alogrithm implemented by Selenium is much more comprehensive and checks more
edge cases. It is still a best guess as to whether an element really is
visible, for example an element with a very low opacity is counted as visible,
even though it probably cannot be seen by an actual human.

Supports JSDOM by skipping the layout and sizing based checks.

## Usage

``` typescript
import { isVisible } from 'element-is-visible';

let element = document.querySelector('#some-element');

isVisible(element) // => true
```

## License

Apache2, see separate LICENSE and NOTICE files.

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