Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ink-gradient

sindresorhus92.4kMIT3.0.0TypeScript support: included

Gradient color component for Ink

ink-component, ink, component, gradient, gradients, color, colors, rainbow, style, styles, react, jsx, terminal, term, console, command-line

readme

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.