Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 566 Bytes

documentVisibility.md

File metadata and controls

30 lines (21 loc) · 566 Bytes

documentVisibility

documentVisibility allows you to observe the visibility state of a document.

Usage

class MyElement extends LitElement {
  constructor() {
    super();

    this._documentVisibilityCtrl = new DocumentVisibilityController(this);
  }

  render() {
    const visibility = this._elementVisibilityCtrl.visible ? 'visible' : 'hidden';

    return html`
      Document is currently ${visibility}.
    `;
  }
}

The visible property will be true or false depending on if the document is currently visible or not.

Options

N/A