> For the complete documentation index, see [llms.txt](https://pmsgz.gitbook.io/nectar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pmsgz.gitbook.io/nectar/advanced/web-apis/page-visibility.md).

# Page Visibility API

## Overview

Page Visibility API allows web apps to know whether it is visible to the user or not.

It is especially useful for saving resources and improving performance by letting the app avoid performing unnecessary tasks when it is not visible.

## Demo

<https://nectar.website/demo/web-apis/page-visibility/>

## Usage

You can refer to the code present in `/partials/web-apis/page-visibility.html` file and use it accordingly.

## Reference

<https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API>
