package box

  1. Overview
  2. Docs
Render boxes in the terminal

Install

Dune Dependency

Authors

Maintainers

Sources

1.2.0.tar.gz
md5=cbf16dadfbcf990070366e255e4708a7
sha512=44d791a884f1712c43aab312a0b2edf390bea473347d373c5c54c2c9110bc846aecf3e3b5d914b5967d4860f1a96456eafca55ea570092764937c9bf05d8ddd3

doc/index.html

Intro

Render boxes in the terminal with OCaml or Reason. Port of sindresorhus/boxen

  ╭─────────────────────────────────────────────────────╮
  │                                                     │
  │   "Render those kinds of boxes in the terminal"     │
  │                                                     │
  ╰─────────────────────────────────────────────────────╯

render text creates a box around your text to print it to the terminal. The text can be aligned to any position and the box can float to any position. Can control the space between the box and the outside with padding Padding.t or the space inside with margin Margin.t. Lastly, can configure the border to be one of the Border.t kinds.

Check the Box page for more details

Examples

utop # print_endline (Box.render ~padding:(Padding.all 2) "I love unicorns");;

┌─────────────────────┐
│                     │
│   I love unicorns   │
│                     │
└─────────────────────┘
  utop # print_endline (Box.render ~padding:(Padding.all 0) "I love unicorns");;

  ┌──────────────────┐
  │ I love unicorns  │
  └──────────────────┘
  utop # print_endline (Box.render ~border:Border.Classic "I love unicorns")

  +-------------------+
  |  I love unicorns  |
  +-------------------+
OCaml

Innovation. Community. Security.

On This Page
  1. Examples