Skip to content

sindresorhus/ink-gradient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jun 10, 2023
b9166c4 · Jun 10, 2023

History

16 Commits
Jun 10, 2023
Jun 10, 2023
Apr 2, 2018
May 16, 2018
Jun 10, 2023
Apr 2, 2018
Aug 10, 2020
Jun 10, 2023
Jun 10, 2023
Apr 2, 2018
Jun 10, 2023
Jun 10, 2023
Jun 10, 2023
Jun 10, 2023

Repository files navigation

ink-gradient

Gradient color component for Ink

Install

npm install ink-gradient

Usage

import React from 'react';
import {render} from 'ink';
import Gradient from 'ink-gradient';
import BigText from 'ink-big-text';

render(
	<Gradient name="rainbow">
		<BigText text="unicorns"/>
	</Gradient>
);

API

<Gradient>

It accepts a string or Ink component as children. For example, <Box/>.

Props

name

Type: string

The name of a built-in gradient.

Mutually exclusive with colors.

colors

Type: string[] | object[]

Colors to use to make the gradient.

Mutually exclusive with name.

Related