Skip to content
Automagical transition of height: auto elements when the content is changed
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.storybook
docs
src
stories
.babelrc
.gitignore
.nvmrc
.prettierrc
LICENSE
README.md
package-lock.json
package.json
webpack.config.js

README.md

AutoHeight

A React component that transitions height: auto children when their content is changed.

Browsers do not support the transition to or from auto value for width and height, see W3C issue csswg-drafts#626 for discussion. This component implements a workaround inspired by the JavaScript technique from CSS-Tricks.

Installation

npm i react-auto-height
# or
yarn add react-auto-height

Usage

import AutoHeight from 'react-auto-height'
...
let content = 'I can be different next render.'
return (
  <AutoHeight>
    {content}
  </AutoHeight>
)

See the Storybook in https://aprillion.github.io/react-auto-height for more examples.

You can’t perform that action at this time.