# @greg.zanchelli/react-animated-grid

> animated grid using react spring

Latest version **1.0.5** (published 2021-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @greg.zanchelli/react-animated-grid
pnpm add @greg.zanchelli/react-animated-grid
yarn add @greg.zanchelli/react-animated-grid
bun add @greg.zanchelli/react-animated-grid
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-10-27 |
| First published | 2021-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 720.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | greg.zanchelli |

## Links

- npm: https://www.npmjs.com/package/@greg.zanchelli/react-animated-grid
- npm.io page: https://npm.io/package/@greg.zanchelli/react-animated-grid

## Dependencies (4)

- [debounce](https://npm.io/package/debounce.md) ^1.2.1
- [@types/debounce](https://npm.io/package/@types/debounce.md) ^1.2.1
- [@react-spring/web](https://npm.io/package/@react-spring/web.md) ^9.3.0
- [react-use-measure](https://npm.io/package/react-use-measure.md) ^2.0.4

## Recent versions

- 1.0.5 (latest) — 2021-10-27
- 1.0.3 — 2021-10-27
- 1.0.2 — 2021-10-27
- 1.0.1 — 2021-10-27
- 1.0.0 — 2021-10-27

## README

# react-animated-grid

A react component for display an animated grid of cards using react-spring

## Install
with yarn
```sh
yarn add @greg.zanchelli/react-animated-grid
```
or using npm

```sh
npm install --save @greg.zanchelli/react-animated-grid
```

# Using

```jsx
import { useState } from "react";
import { AnimatedGrid } from "react-animated-grid";

export default function App() {
  const [data, setData] = useState([
    { id: "a", title: "Title A", content: "content a" },
    { id: "b", title: "Title B", content: "content b" },
    { id: "c", title: "Title C", content: "content c" },
    { id: "d", title: "Title D", content: "content d" },
    { id: "e", title: "Title E", content: "content e" },
  ]);
  return (
    <AnimatedGrid
      data={data}
      defaultColumnCount={1}
      defaultHeight={150}
      trail={5}
      config={{
        mass: 1,
        tension: 1000,
        friction: 100,
        clamp: true,
      }}
      itemWidth={240}
      columnQueries={9}
      windowPadding={0}
      keyFn={(item) => item.id}
      renderFn={(item) => {
        return (
          <div
            style={{
              width: "100%",
              border: "solid 1px black",
              height: 150,
              background: "#eeee",
              boxSizing: "border-box",
              padding: 8,
            }}
          >
            <h1>{item.title}</h1>
            <div>{item.content}</div>
          </div>
        );
      }}
    />
  );
}

```

---
_Source: https://npm.io/package/@greg.zanchelli/react-animated-grid · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
