
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
gradient-boxen
Advanced tools
A combo of gradient-string + boxen
gradient-boxen is a library that allows you to create fully customizable gradient boxes in the terminal. Because what's better than a gradient-y string and a cool terminal box? A gradient box!
It effectively combines the popular NPM packages boxen and gradient-string into one unified package.
Using npm
npm i gradient-boxen
Note This package is ESM only. Please check out this guide on how to convert your project to ESM
Note This package will properly display gradient boxes only in terminals with TrueColor support, ie, 16 million colors, in order to properly display the gradients. This should work alright in most terminal and shells
import gradientBox from 'gradient-boxen';
console.log(
gradientBox(
'I love gradients!',
{
borderStyle: 'round',
padding: 1,
margin: 1,
},
['#11998e', '#38ef7d']
)
);
Output:
import gradientBox from 'gradient-boxen';
console.log(
gradientBox(
'I love gradients!',
{
borderStyle: 'round',
padding: 1,
margin: 1,
},
'fruit'
)
);
Output:
gradientBox(boxText, boxOptions, gradientOptions)
Type: string
Text inside the box. Can be multiline too.
Warning All pre-existing ANSI colors are stripped from the text, so that the gradient can be properly displayed
Type: object
The configuration options for the box as per the boxen package
Options include:
{
borderColor?: string
borderStyle?: string
dimBorder?: boolean
padding?: number
margin?: number
float?: 'left' | 'right' | 'center'
backgroundColor?: 'string'
textAlignment?: 'left' | 'right' | 'center';
title?: string
titleAlignment?: 'left' | 'right' | 'center'
width?: number
height?: number
fullscreen?: boolean
}
Type: string
or string[]
The gradient preset (or a set of gradients) to be used for the box. Can be a string or an array of valid color codes.
A list of presets can be found here
You can support further development of this project by giving it a 🌟 and help me make even better stuff in the future by buying me a ☕
Also, if you liked this repo, consider checking out my other projects, that would be real cool!
FAQs
A combo of gradient-string + boxen
The npm package gradient-boxen receives a total of 35 weekly downloads. As such, gradient-boxen popularity was classified as not popular.
We found that gradient-boxen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.