package console

All checked builds pass
  1. Overview
  2. Docs
On This Page
  1. Panels
Colours, tables, trees and progress rows for the terminal

Install

dune-project
 Dependency

Authors

Maintainers

Sources

console-0.9.0.tbz
sha256=1c6851dbc38514bf717da9bbe9cddda3c2958b215f934dee69324f1ec243873f
sha512=71bd51d2cbaf945ae153e863c2de189b32f3049c750131cc32e96e43759e4d8b62f9bf8863ff2e80429d56d32209573b85d3da9e0d67ad52bb1106b4c763070f

doc/console/Console/Panel/index.html

Module Console.PanelSource

Text in a frame, with an optional title.

Bordered panels with optional titles.

A panel is lines of styled text in a Border, with a title on its top edge and a subtitle on its bottom one.

Panels

Sourceval view : ?border:Border.t -> ?title:View.t -> ?subtitle:View.t -> ?padding:int -> ?expand:bool -> View.t -> View.t

view content is a panel around content, laid out in its room (View.fit): no wider than the room, and its content laid out in the room the frame and the padding leave it.

  • The border is border if given, else the border of the formatter's theme (Theme.get).
  • title labels the top edge, in the theme's Theme.header, and subtitle labels the bottom edge.
  • padding is the internal horizontal padding (defaults to 1).
  • expand (defaults to false) makes the panel as wide as its room, its content and edge labels cut to keep the box a rectangle. Otherwise the panel is sized to its content.

A line wider than the room inside the frame:

  • wraps at its words in a panel sized to its content (View.wrap), hanging under the text after its first word;
  • is cut in a panel that expands (View.truncate), and so are edge labels.

A panel that fits its room is a rectangle. One in a room too narrow for its border has each line cut to the room.