ink-color-pipe
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

ink-color-pipe

chalk-pipe component for Ink 3

Create color text with simpler style strings in Ink

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

Package Sidebar

Install

npm i ink-color-pipe

Weekly Downloads

68

Version

3.0.0

License

MIT

Unpacked Size

4.71 kB

Total Files

5

Last publish

Collaborators

  • litomore