class

Opal::UI::Badge

Inherits Opal::UI::Element < Opal::UI::Themable < Reference < Object

Renders a highlighted tag or pill badge with custom foreground and background colors.

Constructors

new(label : String, bg : Color | Symbol | String = :blue, fg : Color | Symbol | String = :white, bold : Bool = true)
Source

Class methods

to_string(label : String, bg : Color | Symbol | String = :blue, fg : Color | Symbol | String = :white, bold : Bool = true, color : Bool | Nil = nil) : String

Class convenience method returning styled badge string

Source

Instance methods

bg=(bg : Color)
Source
bold=(bold : Bool)
Source
bold?
Source
fg=(fg : Color)
Source
label
Source
label=(label : String)
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source