nlana-ui
v2.0.0
Published
Modern CLI UI library with beautiful effects, glass morphism, gradients, neon glow and more
Maintainers
Readme
🎨 NLANA UI
Modern CLI UI library with beautiful effects, themes, and components for Node.js
✨ Features
- 📦 Box Components - Beautiful boxes with multiple border styles
- 📊 Tables - Data tables with customizable styling
- 🔄 Spinners - 40+ animated loading spinners
- 📈 Progress Bars - Multiple styles with gradients
- 🎨 Text Effects - Gradient, neon, rainbow, matrix, and more
- 🎭 Themes - 10+ built-in themes (cyberpunk, neon, dracula, etc.)
- 📝 ASCII Art - Text to ASCII art generator
- 🔔 Notifications - Toast-style notifications
- 📋 Interactive Menus - Select, confirm, input prompts
- 🌈 Full Color Support - RGB, Hex, and named colors
📦 Installation
npm install nlana-ui🚀 Quick Start
const nlana = require('nlana-ui');
// Create a beautiful box
console.log(nlana.box({
content: 'Hello, World!',
title: '🚀 Welcome',
borderStyle: 'rounded',
borderColor: '#00ffff',
}));
// Gradient text
console.log(nlana.gradient('Beautiful Text', ['#ff0000', '#00ff00', '#0000ff']));
// Neon effect
console.log(nlana.neon('NEON GLOW', 'pink'));
// Rainbow text
console.log(nlana.rainbow('Rainbow Colors!'));📚 Components
📦 Boxes
// Simple box
nlana.box({
content: 'Your content here',
title: 'Title',
borderStyle: 'rounded', // single, double, rounded, bold, classic
borderColor: '#ff00ff',
padding: 1,
});
// Pre-styled boxes
nlana.infoBox('Information message');
nlana.successBox('Success message');
nlana.warningBox('Warning message');
nlana.errorBox('Error message');📊 Tables
// From array of objects
nlana.table({
data: [
{ name: 'John', age: 28 },
{ name: 'Jane', age: 32 },
],
borderStyle: 'rounded',
});
// From headers and rows
nlana.table({
headers: ['Name', 'Age'],
rows: [
['John', '28'],
['Jane', '32'],
],
});
// Key-value table
nlana.kvTable({
Version: '1.0.0',
Author: 'NETHERCODE',
});🔄 Spinners
// Create and start a spinner
const spinner = nlana.spinner('Loading...', 'dots');
spinner.start();
// Update text
spinner.setText('Almost done...');
// Stop with status
spinner.success('Done!');
spinner.error('Failed!');
spinner.warn('Warning!');
spinner.info('Info');
// Available types: dots, dots2, line, star, arc, bounce,
// arrow, clock, earth, moon, pong, shark, and 30+ more!📈 Progress Bars
// Animated progress bar
const progress = nlana.progress({
total: 100,
width: 40,
style: 'default', // default, blocks, classic, line, dots
showPercent: true,
showETA: true,
});
progress.start();
progress.update(50);
progress.increment(10);
progress.stop();
// Static progress bar
console.log(nlana.progressBar(75));🎨 Text Effects
// Gradient
nlana.gradient('Text', ['#ff0000', '#00ff00']);
// Rainbow
nlana.rainbow('Rainbow text');
// Neon glow
nlana.neon('NEON', 'pink'); // pink, cyan, green, red, yellow, blue
// Matrix effect
nlana.matrix('The Matrix');
// Fire & Ice
nlana.fire('FIRE');
nlana.ice('ICE');
// Sunset & Ocean
nlana.sunset('Sunset');
nlana.ocean('Ocean');
// Glass morphism
nlana.glass('Glass effect');📝 ASCII Art
// Basic ASCII art
nlana.ascii('HELLO');
// Rainbow ASCII art
nlana.rainbowAscii('COOL');
// Banner (ASCII in box)
nlana.banner('TITLE');
// Different fonts
nlana.ascii('TEXT', { font: 'block' }); // 3x5, block, slim📋 Interactive Prompts
// Select menu
const choice = await nlana.select({
message: 'Choose an option:',
choices: ['Option 1', 'Option 2', 'Option 3'],
});
// Confirmation
const confirmed = await nlana.confirm({
message: 'Are you sure?',
defaultValue: false,
});
// Text input
const name = await nlana.input({
message: 'Enter your name:',
defaultValue: 'Anonymous',
});
// Multi-select
const selected = await nlana.multiSelect({
message: 'Select features:',
choices: ['Feature A', 'Feature B', 'Feature C'],
});🔔 Notifications
// Toast notifications
nlana.notify.info('Info message');
nlana.notify.success('Success!');
nlana.notify.warning('Warning!');
nlana.notify.error('Error!');
// Badges
nlana.badge('NEW', { backgroundColor: '#ff0000' });
// Status indicators
nlana.status('Running', 'success');
nlana.status('Pending', 'pending');
// Headers & Separators
nlana.header('Section Title');
nlana.separator({ label: 'Divider' });🎭 Themes
// Set global theme
nlana.setTheme('cyberpunk');
// Available themes:
// cyberpunk, neon, retro, minimal, ocean,
// forest, sunset, matrix, dracula, nord
// Get theme
const theme = nlana.getTheme('dracula');
// Create custom theme
nlana.createTheme('myTheme', {
primary: '#ff0000',
secondary: '#00ff00',
background: '#000000',
text: '#ffffff',
});🛠 Utilities
// Terminal control
nlana.clear(); // Clear screen
nlana.utils.hideCursor(); // Hide cursor
nlana.utils.showCursor(); // Show cursor
// Colors
nlana.colorize('Text', 'red');
nlana.colorize('Text', '#ff0000');
// Sleep
await nlana.sleep(1000);🎨 Color Support
// Named colors
nlana.colorize('text', 'red');
nlana.colorize('text', 'cyan');
// Hex colors
nlana.colorize('text', '#ff00ff');
// RGB
nlana.rgb(255, 0, 255);
// Background colors
nlana.bgHex('#ff00ff');📋 Available Border Styles
single- Single line borderdouble- Double line borderrounded- Rounded cornersbold- Bold/thick borderclassic- ASCII characters (+, -, |)arrow- Arrow cornersstars- Star decorationsdots- Dotted bordernone- No border
🎯 Examples
Run the demo:
node examples/demo.jsRun specific demos:
node examples/spinner-demo.js
node examples/progress-demo.js
node examples/menu-demo.js📄 License
MIT © NETHERCODE
Made with ❤️ and lots of ☕
