3.0.0 • Published 3 years ago

ink-color-pipe v3.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

ink-color-pipe

chalk-pipe component for Ink 3

Create color text with simpler style strings in Ink

npm.io

For Ink 2, check ink-color-pipe@1.0.0

Install

$ npm i ink-color-pipe

Usage

This brings you a convenient way to use some color schemes.

import React from 'react';
import {render, Text} from 'ink';
import Color from 'ink-color-pipe';

const link = 'blue.underline';
const error = 'bgRed.white';

render(
	<Text>
		<Color styles={link}>Unicorn</Color>
		<Color styles={error}>{' Error '}</Color>
	</Text>
);

API

<Color>

<Color> is using <Transfrom> for text rendering.

styles

Type: string

Use dot . to separeate multiple styles.

Valid Styles

Related

  • chalk-pipe - Create chalk style schemes with simpler style strings

License

MIT © LitoMore