Class: Flowbite::Badge::Pill

Inherits:
Flowbite::Badge show all
Defined in:
app/components/flowbite/badge/pill.rb

Overview

Renders a pill-shaped badge with fully rounded corners.

Examples:

Basic usage

<%= render(Flowbite::Badge::Pill.new) { "Default" } %>

See Also:

Constant Summary

Constants inherited from Flowbite::Badge

BORDER_CLASSES, SIZES

Instance Attribute Summary

Attributes inherited from Flowbite::Badge

#options

Class Method Summary collapse

Methods inherited from Flowbite::Badge

#bordered?, classes, #dot?, #initialize, #link?, sizes

Constructor Details

This class inherits a constructor from Flowbite::Badge

Class Method Details

.stylesObject

rubocop:disable Layout/LineLength



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/components/flowbite/badge/pill.rb', line 14

def styles
  Flowbite::Styles.from_hash({
    alternative: {
      default: ["bg-neutral-primary-soft", "hover:bg-neutral-secondary-medium", "rounded-full", "text-heading"]
    },
    brand: {
      default: ["bg-brand-softer", "hover:bg-brand-soft", "rounded-full", "text-fg-brand-strong"]
    },
    danger: {
      default: ["bg-danger-soft", "hover:bg-danger-medium", "rounded-full", "text-fg-danger-strong"]
    },
    gray: {
      default: ["bg-neutral-secondary-medium", "hover:bg-neutral-tertiary-medium", "rounded-full", "text-heading"]
    },
    success: {
      default: ["bg-success-soft", "hover:bg-success-medium", "rounded-full", "text-fg-success-strong"]
    },
    warning: {
      default: ["bg-warning-soft", "hover:bg-warning-medium", "rounded-full", "text-fg-warning"]
    }
  }.freeze)
end