Class: Tailwinds::BadgeComponent

Inherits:
BaseComponent show all
Defined in:
app/components/tailwinds/badge_component.rb

Overview

Default Tramway badge

Constant Summary

Constants inherited from BaseComponent

Tailwinds::BaseComponent::TYPE_COLOR_MAP

Instance Method Summary collapse

Methods inherited from BaseComponent

#normalized_type, #resolved_color, #type_color

Methods included from Tramway::Helpers::ViewsHelper

#tramway_back_button, #tramway_badge, #tramway_button, #tramway_cell, #tramway_container, #tramway_flash, #tramway_form_for, #tramway_header, #tramway_row, #tramway_table, #tramway_title

Methods included from Tramway::Helpers::ComponentHelper

#component

Methods included from Tramway::Helpers::DecorateHelper

#tramway_decorate

Instance Method Details

#classesObject



11
12
13
14
15
16
# File 'app/components/tailwinds/badge_component.rb', line 11

def classes
  [
    'flex', 'px-3', 'py-1', 'text-sm', 'font-semibold', 'text-white', "bg-#{resolved_color}-500",
    "dark:bg-#{resolved_color}-600", 'rounded-full', 'w-fit', 'h-fit'
  ]
end