# multiple-equalizer

> Equalizer for multiple elements

Latest version **1.1.0** (published 2022-07-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install multiple-equalizer
pnpm add multiple-equalizer
yarn add multiple-equalizer
bun add multiple-equalizer
```

Provides the command `multiple-equalizer`.

## 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.1.0 |
| Published | 2022-07-08 |
| First published | 2022-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 50.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dianyela Maldonado |
| Maintainers | dianyela-maldonado |
| Keywords | javascript, node, npm |

## Links

- npm: https://www.npmjs.com/package/multiple-equalizer
- Repository: https://github.com/DianyelaMaldonado/multiple-equalizer
- Homepage: https://github.com/DianyelaMaldonado/multiple-equalizer#readme
- Issues: https://github.com/DianyelaMaldonado/multiple-equalizer/issues
- npm.io page: https://npm.io/package/multiple-equalizer

## Dependencies (1)

- [user](https://npm.io/package/user.md) 0.0.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2022-07-08
- 1.0.0 — 2022-07-08

## README

## Multiple Equalizer  📐 

It is made to equalize elements when necessary.
For example the most used case is in cards, so that when one has more content the other adjusts to its size even if it has less content.

### Instalation: 🔧

npm i multiple-equalizer

### Usage:

Import function:

    import { multipleEqualizer } from  "multiple-equalizer"; 
	
Call function on window load and resize:

    window.addEventListener('DOMContentLoaded', () => {
        // Run equalizer when fonts are loaded
        if (typeof document.fonts == 'undefined') {
            multipleEqualizer();
        } else {
            document.fonts.ready.then(function () {
                multipleEqualizer();
            })
        }
    })
    
    window.addEventListener('resize', () => {
        multipleEqualizer();
    })

### Props: 💻

| Property Name               | Description                                                                                                                                                                                                                               | Default Value |
|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| data-alloyEqualize-multiple | Main property of the plugin, this needs to be set on the parent/wrapper component of the elements that are going to be equalized. Its value is a number from 1 to N depending on how many elements of its children needs to be equalized. | -             |
| data-alloyequalize-watch-N  | All the children elements that are going to be equalized needs to have this prop replacing the N with an integer number.                                                                                                                  | -             |

📏 **Example:**

	<div data-alloyEqualize-multiple="3">
		<div class="amazing-card">
			<div data-alloyequalize-watch-1>Your amazing card equalizable title here</div>
			<div data-alloyequalize-watch-2>Your amazing card equalizable summary here</div>
			<div data-alloyequalize-watch-3>Your amazing card equalizable author name here</div>
		</div>
		<div class="amazing-card">
			<div data-alloyequalize-watch-1>Your amazing card equalizable title here</div>
			<div data-alloyequalize-watch-2>Your amazing card equalizable summary here</div>
			<div data-alloyequalize-watch-3>Your amazing card equalizable author name here</div>
		</div>
		<div class="amazing-card">
			<div data-alloyequalize-watch-1>Your amazing card equalizable title here</div>
			<div data-alloyequalize-watch-2>Your amazing card equalizable summary here</div>
			<div data-alloyequalize-watch-3>Your amazing card equalizable author name here</div>
		</div>
	</div>
	
🥽 The end result would be something like this:

![multiple equalizer cards example](https://i.imgur.com/pMMVvVi.png)

### How it works: ⚙⚙⚙

- Each element inside the parent **data-alloyEqualize-multiple** will have the same height as the tallest element

- Sibling items **[attr^="data-alloyequalize-watch-"]** are compared as long as they belong to the same parent element, regardless of whether the front-end visually displays a row

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