Class: NattyUI::Frame

Inherits:
Element show all
Defined in:
lib/natty-ui/frame.rb

Overview

An Element that draws a Unicode border box around its content.

Instances are created by NattyUI::Features#frame. An optional title can be embedded in the top border line. The border style and ANSI colour are configurable.

All Features methods are available on this element.

Examples:

Via block (auto-close)

ui.frame 'Results', border: :double do
  ui.puts 'All checks passed.'
end

Manual close

frm = ui.frame 'Preview'
ui.puts 'Content inside the frame.'
frm.end