Border Types
Set the :border keyword to one of the following:
:ascii:light (default):thick
Customizing Border Parts
You can pass a hash to :border to customize specific parts or use false to remove them.
Border parts: :top, :top_left, :top_right, :left, :right, :bottom_left, :bottom_right, :bottom.
Border values: :line, :pipe, :cross, :divider_up, :divider_down, :divider_left, :divider_right, :corner_top_left, :corner_top_right, :corner_bottom_left, :corner_bottom_right.
Styling
Use the :style keyword to set foreground (:fg) and background (:bg) colors for both the content and the border. Use enable_color: true to force color output.
# Customizing specific corners with :cross
box = TTY::Box.frame(
width: 10, height: 4,
border: {
top_left: :cross,
top_right: :cross,
bottom_left: :cross,
bottom_right: :cross
}
)
# Styling with colors
TTY::Box.frame({
enable_color: true,
style: {
fg: :bright_yellow,
bg: :blue,
border: {
fg: :bright_yellow,
bg: :blue
}
}
})