Skip to content

Rule

A horizontal divider/separator for Ink 5 with optional centred label.

Install

Terminal window
npm install @matthesketh/ink-rule

Usage

import { Rule } from '@matthesketh/ink-rule';
// simple horizontal rule
<Rule />
// with a centred title
<Rule title="Section" />
// custom character and colour
<Rule char="=" color="cyan" />
// fixed width
<Rule width={40} title="Info" />

Props

PropTypeDefaultDescription
titlestringcentred label in the rule
charstring'\u2500'character used to draw the line
colorstring'grey'colour of the line characters
widthnumberprocess.stdout.columnswidth of the rule in columns

License

MIT