Align CLI text using Ink components
You can align horizontally using the Left
, Center
and Right
components.
import { render, h } from 'ink'
import { Left, Center, Right } from 'ink-align'
render(
<div>
<Left>I am left aligned</Left>
<Right>I am right aligned</Right>
<Center>I am center aligned</Center>
</div>
)
You can align vertically using the Middle
component. (Tip: you can combine this with Center!)
import { render, h } from 'ink'
import { Center, Middle } from 'ink-align'
render(
<Middle>
<Center>Hello there.</Center>
</Middle>
)
ink-align © 2018+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).
(Thanks Alina Oleynik for the icon!)
ricostacruz.com · GitHub @rstacruz · Twitter @rstacruz