# adjust

> Adjust an element relative to another element

Latest version **2.1.1** (published 2015-10-28) · 0 weekly downloads

## Install

```sh
npm install adjust
pnpm add adjust
yarn add adjust
bun add adjust
```

## 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 | 2.1.1 |
| Published | 2015-10-28 |
| First published | 2015-08-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Author | Matthew Mueller |
| Maintainers | mattmueller |
| Keywords | adjust, position |

## Links

- npm: https://www.npmjs.com/package/adjust
- Repository: https://github.com/MatthewMueller/adjust
- Homepage: https://github.com/MatthewMueller/adjust#readme
- Issues: https://github.com/MatthewMueller/adjust/issues
- npm.io page: https://npm.io/package/adjust

## Dependencies (5)

- [right-now](https://npm.io/package/right-now.md) ^1.0.0
- [scrollparent](https://npm.io/package/scrollparent.md) ^0.1.0
- [adjust-engine](https://npm.io/package/adjust-engine.md) ^2.0.4
- [component-raf](https://npm.io/package/component-raf.md) ^1.2.0
- [translate-component](https://npm.io/package/translate-component.md) 0.0.1

## Recent versions

- 2.1.1 (latest) — 2015-10-28
- 2.1.0 — 2015-09-01
- 2.0.3 — 2015-08-31
- 2.0.2 — 2015-08-31
- 2.0.1 — 2015-08-31
- 2.0.0 — 2015-08-25
- 1.0.0 — 2015-08-20

## README

# adjust

  Light-weight version of [HubSpot/tether](https://github.com/HubSpot/tether).

## Features

Supports all the [main features of tether](http://github.hubspot.com/tether/overview/why_you_should_use_tether/):

- Optimized GPU-accelerated repositioning for 60fps scrolling
- Reliable positioning on any possible corner, edge or point in between.
- Support for repositioning or pinning the element when it would be offscreen
- Designed to be embeddable in other libraries

It does differ from tether in a few key ways:

- **File size**: Adjust is 16kb unminified, tether is 50kb unminified. The Adjust codebase is also modularized allowing you to reuse modules throughout the codebase and reduce the footprint added even further.

- **Less Mucking**: Unlike Tether, Adjust does not change the DOM tree. Moving DOM nodes often leads to unintended consequences. I find that it's much easier to modify the DOM structure manually than have a library try and pick a structure for you.

- **Less Features**: Tether has some additional options around constraints and pinning.
It also does more to try and optimize location placement. Some of these things may get added as needed, but the goal is to build higher-level tooltips and dropdowns, without being concerned with the added filesize.

## Usage

```js
var tooltip = document.querySelector('.tooltip')
var target = document.querySelector('.target')
var adjust = require('adjust')()

adjust(tooltip, target, {
  attachment: 'bottom middle'
  target: 'top middle',
  offset: {
    y: 10
  }
})
```

## Installation

```
npm install adjust
```

## License

MIT

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