# overlay-basis

> Simple overlay component

Latest version **0.3.0** (published 2017-12-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install overlay-basis
pnpm add overlay-basis
yarn add overlay-basis
bun add overlay-basis
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2017-12-23 |
| First published | 2017-10-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Serge Mazille |
| Maintainers | sergemazille |
| Keywords | overlay |

## Links

- npm: https://www.npmjs.com/package/overlay-basis
- Repository: https://github.com/sergemazille/overlay-basis
- Homepage: https://github.com/sergemazille/overlay-basis#readme
- Issues: https://github.com/sergemazille/overlay-basis/issues
- npm.io page: https://npm.io/package/overlay-basis

## Recent versions

- 0.3.0 (latest) — 2017-12-23
- 0.2.0 — 2017-10-27
- 0.1.4 — 2017-10-27
- 0.1.2 — 2017-10-27
- 0.1.1 — 2017-10-23
- 0.1.0 — 2017-10-23
- 0.0.4 — 2017-10-22
- 0.0.3 — 2017-10-20
- 0.0.2 — 2017-10-20
- 0.0.1 — 2017-10-20

## README

# Overlay Basis

Simple overlay component

Works on modern browsers only (uses es6 modules and css custom properties)


## Usage

On page load, Overlay Basis creates and appends an `#overlay` element on the DOM.

You need to add Overlay Basis stylesheet to your own (change this examples with your file path):

if you use less or sass:

`@import '~overlay-basis/src/overlay';`

or directly in your html file:

`<link rel="stylesheet" href="stylesheets/overlay.css">`

To create and use the overlay component in your project, import and initialize the library in your javascript file:

```typescript
import Overlay from 'overlay-basis/src/overlay';
let overlay = new Overlay();
overlay.init()
``` 

You can then use its methods:

### show()

Nothing really fancy here, the overlay will appear on screen:

`overlay.show();`

### hide()

Hide the overlay:

`overlay.hide();`

### lock()

You can add the `.is-locked` class to the overlay by calling `overlay.lock()` before showing it:

`overlay.lock();`

`overlay.show();`

By default it will use a 'not-allowed' icon cursor on mouse hovering.
The `body` element of the page will also be locked (not scrollable).

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