📦 Boxx
Create highly customizable terminal boxes that also look great!
Installation:
Install using
vpkg
vpkg get https://github.com/thecodrr/boxx
Install using
V
vpm
v install thecodrr.boxx
Install using
git
cd path/to/your/project
git clone https://github.com/thecodrr/boxx
All the awesome
color support
v install thecodrr.crayon
Then in the wherever you want to use it:
import boxx // or with vpm use thecodrr.boxx
And that's it!
Usage
boxx.new(
Config
)
Initializes a new
Box
Config
box := boxx.new(boxx.Config{px: 2, py: 1, typ: "single", color: "green"})
box.print("Boxx is a great start for CLI tools.", "Welcome to Boxx!")
Config
px
py
content_align
color
rgb
typ
title_position
inside
top
bottom
Box Types:
1.
single
2.
single_double
3.
double_single
4.
bold
5.
round
6.
classic
7.
hidden
8.
double
Title Positions:
1.
inside
2.
top
3.
bottom
Boxx
struct
You can create your own boxes as well if you want using the following values:
struct Boxx {
top_right string //the top right corner symbol
top_left string //the top left corner symbol
vertical string //the symbol used for the vertical bars
horizontal string //the symbol used for the horizontal bars
bottom_right string //the bottom right corner symbol
bottom_left string //the bottom left corner symbol
}
Example:
box := &boxx.Boxx {
top_right: "x"
top_left: "x"
bottom_right: "x"
    bottom_left: "x"
vertical: "+"
horizontal: "+"
}
Boxx.print(
string
,
string
)
Print the box according to the specified config.
Params:
text
title
Find this library useful? :heart:
Support it by joining
stargazers
Much thanks to the developers of these repos:
License
MIT License
Copyright (c) 2019 Abdullah Atta
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.