patchkit-vertical-filled

1.0.1 • Public • Published

Vertical Filled Container

A container-component that will take the full vertical space, and resize with the window.

import VerticalFilledContainer from 'patchkit-vertical-filled'
 
<VerticalFilledContainer>
  This container will extend to the bottom of the screen, even when you resize.
</VerticalFilledContainer>

You can use the decorator to add the behavior to another component. This is the actual definition of <VerticalFilledContainer>:

import { verticalFilled } from 'patchkit-vertical-filled'
 
class _VerticalFilledContainer extends React.Component {
  render() {
    var style = { position: 'relative', overflow: 'auto' }
    
    if (this.props.height)
      style.height = this.props.height
 
    if (this.props.style && typeof this.props.style == 'object') {
      for (var k in this.props.style)
        style[k] = this.props.style[k]
    }
 
    return <div className="vertical-filled" {...this.props} style={style}>{this.props.children||''}</div>
  }
}
var VerticalFilledContainer = verticalFilled(_VerticalFilledContainer)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    4
  • 1.0.0
    1

Package Sidebar

Install

npm i patchkit-vertical-filled

Weekly Downloads

2

Version

1.0.1

License

GPL-3.0

Last publish

Collaborators

  • pfraze