# handy-highlight

> A tiny, useful & handy highlight system which can be used with a simple API!

Latest version **1.0.2** (published 2018-07-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install handy-highlight
pnpm add handy-highlight
yarn add handy-highlight
bun add handy-highlight
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-07-22 |
| First published | 2017-07-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | takkar |
| Maintainers | takkar |
| Keywords | handy, takkar, highlight |

## Links

- npm: https://www.npmjs.com/package/handy-highlight
- Repository: https://github.com/yTakkar/Handy-Highlight
- Homepage: https://github.com/yTakkar/Handy-Highlight#readme
- Issues: https://github.com/yTakkar/Handy-Highlight/issues
- npm.io page: https://npm.io/package/handy-highlight

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-07-22
- 1.0.1 — 2017-07-14
- 1.0.0 — 2017-07-14

## README

# Handy-Highlight

A very handy tool for highlighting the text & having fun with it - Inspired by [Medium](https://medium.com). Demo below!!

# Quick links
1. [Usage](#usage)
2. [Demo](#demo)
3. [API](#api)

# Usage
1. Install with `npm` or `Yarn`.

    ```
    npm install handy-highlight
    ```
    or
    ```
    yarn add handy-highlight
    ```

2. Add these `divs` to your markup.

    ```html
    <div id="cal1">&nbsp;</div>
    <div id="cal2">&nbsp;</div>
    <div id="handy-tooltip"></div>
    ```

3. Copy everything of `/highlight.css` into your stylesheet.

4. Here comes the fun part. Should be used on `mouseup` function on `window` object.

    ```javascript
    import Highlight from 'handy-highlight'
    window.onmouseup = function(){
        Highlight({
            onclick: function(){ /*YOUR STUFF HERE*/ },   // is executed when div is clicked
            text: "<b>Hello, World</b>"   // Ignore this property if you want div's text to be highlighted text
        });
    }
    ```

# Demo
**Visit [this](https://codesandbox.io/s/6xv0xq3o53) link for the demo!!**

# API
```javascript
Highlight(options:Object)
options = {
    extraTop:Number,
    extraLeft:Number,
    text:String,
    onclick:Function
}
```

<dl>
  <dt>extraTop:</dt>
  <dd>Add some extra top to the div.</dd>

  <dt>extraLeft:</dt>
  <dd>Add some extra left to the div.</dd>

  <dt>text:</dt>
  <dd>Text of the div. Ignore this property if you want div's text to be the highlighted text.</dd>

  <dt>onclick:</dt>
  <dd>Function to be executed when clicked on the div.</dd>
</dl>

**Thnx for reading!!**

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