react-centpn

0.0.7 • Public • Published

react-centpn

npm npm Travis Codecov cdn

Simple react component to center children vertically.

Installation

yarn add react-centpn

Usage

import Center from 'react-centpn'

export default () =>
  <div {...{ style: { position: 'relative', height: '100%' } }}>
    <Center {...{ top: -20 }}>
      <div {...{ style: { height: 100 } }}></div>
    </Center>
  </div>

Props

top: number | string

Used as calc(50% - ${contentHeight / 2} + (props.top)).

props.top as number will be processed ${props.top}px.

License

MIT (http://opensource.org/licenses/MIT)

Readme

Keywords

Package Sidebar

Install

npm i react-centpn

Weekly Downloads

1

Version

0.0.7

License

MIT

Unpacked Size

19.8 kB

Total Files

7

Last publish

Collaborators

  • kthjm