Skip to content

rstacruz/ink-align

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



ink-align

Align CLI text using Ink components


⚠️ Work in progress! This allows you to align text in Ink (React for command-line apps). Supports colors and everything.

Basic examples

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>
)

Thanks

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

 

About

Align CLI text using Ink components

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published