Class: BetterUi::FaIconComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- BetterUi::FaIconComponent
- Defined in:
- app/components/better_ui/fa_icon_component.rb
Constant Summary collapse
- STYLES =
{ regular: "fa-regular", solid: "fa-solid", light: "fa-light", thin: "fa-thin", brands: "fa-brands" }.freeze
- SIZES =
{ xs: "fa-xs", sm: "fa-sm", md: nil, lg: "fa-lg", xl: "fa-xl", "2xl": "fa-2xl" }.freeze
- FLIPS =
{ horizontal: "fa-flip-horizontal", vertical: "fa-flip-vertical", both: "fa-flip-both" }.freeze
- ROTATIONS =
{ 90 => "fa-rotate-90", 180 => "fa-rotate-180", 270 => "fa-rotate-270" }.freeze
Constants inherited from ApplicationComponent
ApplicationComponent::SHADOWS, ApplicationComponent::VARIANTS, ApplicationComponent::VARIANT_BODY_DIVIDE, ApplicationComponent::VARIANT_DIVIDE, ApplicationComponent::VARIANT_HEADER_BG, ApplicationComponent::VARIANT_HEADER_TEXT, ApplicationComponent::VARIANT_HIGHLIGHTED, ApplicationComponent::VARIANT_HOVERABLE, ApplicationComponent::VARIANT_RING, ApplicationComponent::VARIANT_SORT_ICON, ApplicationComponent::VARIANT_STRIPED
Instance Method Summary collapse
-
#initialize(name:, style: :regular, variant: nil, size: :md, spin: false, pulse: false, flip: nil, rotate: nil, fixed_width: false, container_classes: nil, **options) ⇒ FaIconComponent
constructor
A new instance of FaIconComponent.
Constructor Details
#initialize(name:, style: :regular, variant: nil, size: :md, spin: false, pulse: false, flip: nil, rotate: nil, fixed_width: false, container_classes: nil, **options) ⇒ FaIconComponent
Returns a new instance of FaIconComponent.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'app/components/better_ui/fa_icon_component.rb', line 34 def initialize( name:, style: :regular, variant: nil, size: :md, spin: false, pulse: false, flip: nil, rotate: nil, fixed_width: false, container_classes: nil, ** ) @name = name @style = validate_style(style) @variant = validate_variant(variant) @size = validate_size(size) @spin = spin @pulse = pulse @flip = validate_flip(flip) @rotate = validate_rotate(rotate) @fixed_width = fixed_width @container_classes = container_classes = end |