class Opal::UI::Badge

Overview

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

Defined in:

opal/ui/components/badge.cr

Constructors

Instance Method Summary

Instance methods inherited from class Opal::UI::Element

preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32) preferred_size, render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil render

Constructor Detail

def self.new(label : String, bg : Color | Symbol | String = :blue, fg : Color | Symbol | String = :white, bold : Bool = true) #

[View source]

Instance Method Detail

def bg : Color #

[View source]
def bg=(bg : Color) #

[View source]
def bold=(bold : Bool) #

[View source]
def bold? : Bool #

[View source]
def fg : Color #

[View source]
def fg=(fg : Color) #

[View source]
def label : String #

[View source]
def label=(label : String) #

[View source]
def preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32) #

[View source]
def render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil #

[View source]