Skip to content

Repository files navigation

logo react equalize

CircleCI

Equalize the height of your elements in your page.

Installation

 npm install react-equalize

Usage

  1. Wrap the list of elements you want to equalize the height
importReactfrom"react";import{EqualizerContainer}from"react-equalize";importsamplesfrom'./samples';importCardfrom'./Card';constList=()=>(<div><h2>List</h2><EqualizerContainer>{samples.map(sample=>(<Cardtitle={sample.title}img={sample.img}/>))}</EqualizerContainer></div>);exportdefaultList;
  1. Equalize the elements of your choice
// Card.jsimportReactfrom"react";import{Equalize}from"react-equalize";constCard=({ title, img, description })=>(<div><p><Equalize>{title}</Equalize></p><Equalize><imgsrc={img}width="100%"alt="boo"/></Equalize><p><Equalize>{description}</Equalize></p></div>);exportdefaultCard;

Edit react-equalize-example

API

PropTypeDescription
elementsArrayList of elements that should re-trigger the calculation.

About

Match the elements to the same height in a row

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages