# height-transition

> Simple height transition for collapse elements.

Latest version **0.2.1** (published 2019-03-12) · 0 weekly downloads

## Install

```sh
npm install height-transition
pnpm add height-transition
yarn add height-transition
bun add height-transition
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2019-03-12 |
| First published | 2019-03-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Metin Süt |
| Maintainers | metinsut |
| Keywords | react, hooks, height, transition, height-transition |

## Links

- npm: https://www.npmjs.com/package/height-transition
- Homepage: https://github.com/metinsut/height-transition
- npm.io page: https://npm.io/package/height-transition

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2019-03-12
- 0.2.0 — 2019-03-11
- 0.1.9 — 2019-03-11
- 0.1.8 — 2019-03-11
- 0.1.7 — 2019-03-11
- 0.1.6 — 2019-03-08
- 0.1.5 — 2019-03-08
- 0.1.4 — 2019-03-07
- 0.1.2 — 2019-03-07
- 0.1.1 — 2019-03-07
- 0.1.0 — 2019-03-07

## README

## Basic Height Transition Library for React
Simple height transition for collapse elements.

## Installation
This library written with react-hook so you have to install version of react 16.8.4 or above.
```sh
npm i height-transition -S
```

## Setup
Just connect your button with its ref and pass to props HeightTransition component.
```javascript
import React, { Fragment, useRef } from 'react';
import HeightTransition from 'height-transition';

const App = () => {
   const toggleElem = useRef(null);
     return (
    <Fragment>
      <button ref={toggleElem}>Toggle</button>
      <HeightTransition 
         styles={styles} 
         toggle={toggleElem} 
         animation="ease-out" 
         time="100ms"
         >
        Your Content
      </HeightTransition>
    </Fragment>
  );
}
```

## API
| Api | Description | Default |
| ------ | ------ | ------ |
| styles | Set your own style. |
| toggle | Set your element ref |
| animation | Set your animation style | default : "ease" |
| time | Set your animation time | default : "300ms" |

## Live Example

[![Checkout](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/381vprmr15?fontsize=14)

## License
MIT

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