- Box ⇐
Control
The configuration for the Box class.
Kind: global interface
Properties
Name | Type | Description |
---|---|---|
id | string |
The id of the box. |
x | number |
The x position of the box. |
y | number |
The y position of the box. |
[width] | number |
The width of the box. |
[height] | number |
The height of the box. |
[style] | BoxStyle |
The style of the box. |
[visible] | boolean |
If the box is visible. |
[draggable] | boolean |
If the box is draggable. |
The style of the box.
Kind: global interface
Properties
Name | Type | Description |
---|---|---|
[boxed] | boolean |
If the box is boxed. |
[color] | chalk.ForegroundColorName | HEX | RGB | "" |
The color of the box. |
[label] | string |
The label of the box. |
Kind: global class
Extends: Control
The class that represents a box.
Example of a box containing a list of process running on the computer.
Param | Type | Description |
---|---|---|
config | BoxConfig |
The configuration of the box. |
Example
const box = new Box({
id: "box",
x: 0,
y: 0,
width: 10,
height: 5,
style: { boxed: true, color: "red", label: "Box" }
})
box.setContent(new InPageWidgetBuilder(5).addText("Hello World!"))