class Opal::UI::StackBuilder

Overview

Builder for stack children

Defined in:

opal/ui/dsl.cr

Instance Method Summary

Instance Method Detail

def add(el : Element) : Nil #

[View source]
def badge(label : String, bg : Color | Symbol | String = :blue, fg : Color | Symbol | String = :white, bold : Bool = true) : Badge #

[View source]
def barchart(title : String | Nil = nil, bar_char : Char = '█', max_value : Float64 | Nil = nil, &block : BarChartBuilder -> Nil) : BarChart #

[View source]
def box(border : Symbol | Border = :rounded, border_fg : Color | Symbol | String = Color.none, padding : Int32 = 0, title : String | Nil = nil, title_fg : Color | Symbol | String = :cyan, &block : Builder -> Nil) : Box #

[View source]
def code_view(code : String, language : Symbol = :plain, start_line : Int32 = 1, highlighted_line : Int32 | Nil = nil, scroll_offset : Int32 = 0, show_line_numbers : Bool = true, gutter_fg : Color | Symbol | String = :dark_gray, cursor_fg : Color | Symbol | String = :yellow) : CodeView #

[View source]
def elements : Array(Element) #

[View source]
def gauge(ratio : Float64, label : String | Nil = nil, color : Color | Symbol | String | Nil = nil, filled_char : Char = '█', empty_char : Char = '░') : Gauge #

[View source]
def hex_viewer(bytes : Bytes | Slice(UInt8) | Array(UInt8), base_address : UInt64 = 0_u64, bytes_per_row : Int32 = 16, scroll_offset : Int32 = 0, selected_byte : Int32 | Nil = nil) : HexViewer #

[View source]
def hstack(spacing : Int32 = 0, &block : StackBuilder -> Nil) : HStack #

[View source]
def markdown(content : String, width : Int32 = 80) : MarkdownElement #

[View source]
def rule(char : Char = '─', fg : Color | Symbol | String = Color.none) : Rule #

[View source]
def sparkline(data : Array(Float64), color : Color | Symbol | String = :cyan, title : String | Nil = nil, min : Float64 | Nil = nil, max : Float64 | Nil = nil) : Sparkline #

[View source]
def split_view(direction : SplitDirection = SplitDirection::Horizontal, ratio : Float64 | Nil = 0.5, first_size : Int32 | Nil = nil, second_size : Int32 | Nil = nil, separator : Char | Nil = nil, separator_fg : Color | Symbol | String = Color.none, focused_pane : Symbol = :first, show_separator : Bool = true, &block : SplitBuilder -> Nil) : SplitView #

[View source]
def table(headers : Array(String) = [] of String, header_fg : Color | Symbol | String = :cyan, border_fg : Color | Symbol | String = Color.none, &block : TableBuilder -> Nil) : Table #

[View source]
def tabs(labels : Array(String), active_index : Int32 = 0, active_fg : Color | Symbol | String = :bright_white, active_bg : Color | Symbol | String = :blue, inactive_fg : Color | Symbol | String = :gray, pill_style : Bool = false) : Tabs #

[View source]
def text(content : String, fg : Color | Symbol | String = Color.none, bg : Color | Symbol | String = Color.none, bold : Bool = false, dim : Bool = false, italic : Bool = false, underline : Bool = false) : Text #

[View source]
def tree(title : String | Nil = nil, &block : TreeBuilder -> Nil) : Tree #

[View source]
def vstack(spacing : Int32 = 0, &block : StackBuilder -> Nil) : VStack #

[View source]