1.0.3 • Published 8 months ago

react-inline-center v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
8 months ago

react-inline-center

npm version minzipped size module

Centering inline elements like magic:

  • No need to add the wrapper element
  • The child element (image, icon etc.) can be any size
  • Only align to the first line of adjacent text

Install

npm install react-inline-center

Demo

Usage

import InlineCenter from 'react-inline-center'

render(
  <>
    <Button>
      <InlineCenter>
        <MyIcon />
      </InlineCenter>
      label.
    </Button>
    <p>
      <InlineCenter>
        <image />
      </InlineCenter>
      text.
    </p>
  </>
)