Skip to content

Latest commit

 

History

History
78 lines (61 loc) · 2.28 KB

Box.md

File metadata and controls

78 lines (61 loc) · 2.28 KB

Classes

BoxControl

Interfaces

BoxConfig : Object

The configuration for the Box class.

BoxStyle : Object

The style of the box.

BoxConfig : Object

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.

BoxStyle : Object

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.

Box ⇐ Control

Kind: global class
Extends: Control

new Box(config)

The class that represents a box.

image

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!"))