Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/ink-gradient
Gradient color component for Ink
https://github.com/sindresorhus/ink-gradient
chalk cli colors gradients ink ink-component jsx nodejs npm-package react
Last synced: 3 days ago
JSON representation
Gradient color component for Ink
- Host: GitHub
- URL: https://github.com/sindresorhus/ink-gradient
- Owner: sindresorhus
- License: mit
- Created: 2018-04-02T05:05:55.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-06-10T13:53:35.000Z (over 1 year ago)
- Last Synced: 2024-12-17T12:23:04.963Z (8 days ago)
- Topics: chalk, cli, colors, gradients, ink, ink-component, jsx, nodejs, npm-package, react
- Language: TypeScript
- Size: 29.3 KB
- Stars: 148
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# ink-gradient
> Gradient color component for [Ink](https://github.com/vadimdemedes/ink)
![](screenshot.png)
## Install
```sh
npm install ink-gradient
```## Usage
```js
import React from 'react';
import {render} from 'ink';
import Gradient from 'ink-gradient';
import BigText from 'ink-big-text';render(
);
```## API
### ``
It accepts a string or Ink component as `children`. For example, [``](https://github.com/vadimdemedes/ink#box).
#### Props
##### name
Type: `string`
The name of a [built-in gradient](https://github.com/bokub/gradient-string#available-built-in-gradients).
Mutually exclusive with `colors`.
##### colors
Type: `string[] | object[]`
[Colors to use to make the gradient.](https://github.com/bokub/gradient-string#initialize-a-gradient)
Mutually exclusive with `name`.
## Related
- [ink-big-text](https://github.com/sindresorhus/ink-big-text) - Awesome text component for Ink
- [ink-link](https://github.com/sindresorhus/ink-link) - Link component for Ink