Class: FoxTail::CarouselComponent

Inherits:
BaseComponent show all
Includes:
FoxTail::Concerns::HasStimulusController
Defined in:
app/components/fox_tail/carousel_component.rb

Defined Under Namespace

Classes: StimulusController

Instance Attribute Summary

Attributes inherited from BaseComponent

#html_attributes

Instance Method Summary collapse

Methods inherited from BaseComponent

classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class

Methods inherited from Base

fox_tail_config

Constructor Details

This class inherits a constructor from FoxTail::BaseComponent

Instance Method Details

#before_renderObject



30
31
32
33
34
# File 'app/components/fox_tail/carousel_component.rb', line 30

def before_render
  super

  html_attributes[:class] = classnames theme.apply(:root, self), html_class
end

#render?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'app/components/fox_tail/carousel_component.rb', line 26

def render?
  slides?
end

#stimulus_controller_optionsObject



36
37
38
39
40
41
42
43
44
45
46
47
# File 'app/components/fox_tail/carousel_component.rb', line 36

def stimulus_controller_options
  {
    position: position,
    interval: interval,
    previous_slide_classes: previous_slide_classes,
    current_slide_classes: current_slide_classes,
    next_slide_classes: next_slide_classes,
    hidden_slide_classes: hidden_slide_classes,
    active_indicator_classes: active_indicator_classes,
    inactive_indicator_classes: inactive_indicator_classes
  }
end