Skip to content

🌈 Create color text with simpler style strings in Ink

License

Notifications You must be signed in to change notification settings

LitoMore/ink-color-pipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ink-color-pipe

chalk-pipe component for Ink 5

Create color text with simpler style strings in Ink

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