yacui
v0.1.11
Published
This is a Node.js project to create user interface for the console.
Downloads
13
Maintainers
Readme
yacui (yet another console ui)
This is a Node.js project to create user interface for the console.
Table of content
Getting started
npm i yacui
Require
// ESM
import { Modal } from 'yacui';
// CommonJs
const { Modal } = require('yacui');
Components
Window
import { Window } from 'yacui';
const window = new Window()
.withTitle('My title')
.withFooter({ items: ['[F10] Quit'] })
.withWidth(50)
.withHeight(10)
.build();
When we print the modal we will get the following.
╔════════════════════════════════════════════════╗
║ My title ║
╠════════════════════════════════════════════════╣
║ ║
║ ║
║ ║
║ ║
╠════════════════════════════════════════════════╣
║ [F10] Quit ║
╚════════════════════════════════════════════════╝
Modal
import { Modal } from 'yacui';
const modal = new Modal()
.withTitle('My title')
.withBody('This is a sample body for testing and it is occupying multiple lines.')
.withYesButton()
.withNoButton()
.withOkayButton()
.withCloseButton()
.build();
When we print the modal we will get the following.
┌─────────────────────────────────┐
│ My title │░
├─────────────────────────────────┤░
│ This is a sample body for │░
│ testing and it is occupying │░
│ multiple lines. │░
│ │░
├─────────────────────────────────┤░
│ [Y]es [N]o [O]kay [C]lose │░
└─────────────────────────────────┘░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
License
It's free :smiley:
MIT License Copyright (c) 2024 Yusuf Shakeel
Donate
Feeling generous :smiley: Donate via PayPal