Panel

class Panel : Widget

A box drawn around another widget, with optional top and bottom titles.

Example

terminal.print(Panel(
"my panel content",
title = "title",
bottomTitle = "subtitle",
titleAlign = TextAlign.LEFT,
bottomTitleAlign = TextAlign.RIGHT
))
╭─ title ────────╮
│my panel content│
╰───── subtitle ─╯

Constructors

Link copied to clipboard
constructor(content: Widget, title: Widget? = null, bottomTitle: Widget? = null, expand: Boolean = false, padding: Padding = DEFAULT_PADDING, borderType: BorderType? = BorderType.ROUNDED, titleAlign: TextAlign = CENTER, bottomTitleAlign: TextAlign = titleAlign, borderStyle: TextStyle? = null, titlePadding: Int? = null)
constructor(content: String, title: String? = null, bottomTitle: String? = null, expand: Boolean = false, padding: Padding = DEFAULT_PADDING, borderType: BorderType? = BorderType.ROUNDED, titleAlign: TextAlign = CENTER, bottomTitleAlign: TextAlign = titleAlign, borderStyle: TextStyle? = null, titlePadding: Int? = null)

Functions

Link copied to clipboard
open override fun measure(t: Terminal, width: Int): WidthRange
Link copied to clipboard
open override fun render(t: Terminal, width: Int): Lines
Link copied to clipboard
fun Widget.withPadding(padding: Padding, padEmptyLines: Boolean = true): Widget

Add padding around this widget.

fun Widget.withPadding(padEmptyLines: Boolean = true, padding: Padding.Builder.() -> Unit): Widget
fun Widget.withPadding(all: Int, padEmptyLines: Boolean = true): Widget
fun Widget.withPadding(top: Int, right: Int, bottom: Int, left: Int, padEmptyLines: Boolean = true): Widget