Ink Gradient Documentation

Installation#

npm install ink-gradient

Usage#

To use Ink Gradient in your terminal application, you can import it and apply it to your text as follows:

import gradient from 'ink-gradient';
import { Text } from 'ink';
 
const MyComponent = () => (
    <Text>
        <gradient>Beautiful Gradient Text</gradient>
    </Text>
);

API#

Functions#

gradient(colors: string | string[], options?: object): ReactNode#

  • colors: A string or an array of strings representing the colors for the gradient.
  • options: An optional object to customize the gradient behavior.

Example:

<gradient colors={['#FF5733', '#33FF57', '#3357FF']}>
    Custom Gradient Text
</gradient>

Options#

  • type: (string) The type of gradient. Options include linear and radial. Default is linear.
  • angle: (number) The angle of the gradient in degrees. Default is 0.

Contributing#

To contribute to the Ink Gradient project, follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes and commit them (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Open a pull request.

License#

This project is licensed under the MIT License. See the LICENSE file for details.

Updated

Was this page helpful?