Class: Shadcn::Slider::Track::Component

Inherits:
ApplicationViewComponent show all
Defined in:
app/components/shadcn/slider/track/component.rb

Overview

The groove. Its own file only for data-orientation, which every part of this family carries and which part does not do.

Constant Summary

Constants inherited from ApplicationViewComponent

ApplicationViewComponent::CONTENTS_STYLE, ApplicationViewComponent::VOID_TAGS

Instance Attribute Summary collapse

Attributes inherited from ApplicationViewComponent

#attributes

Instance Method Summary collapse

Methods inherited from ApplicationViewComponent

#call, #css_classes, default_tag, #merged_style, #render_element, #shadcn_t, slot_name, #style_variants, #tag_name

Constructor Details

#initialize(orientation: :horizontal, **attributes) ⇒ Component

Returns a new instance of Component.



21
22
23
24
# File 'app/components/shadcn/slider/track/component.rb', line 21

def initialize(orientation: :horizontal, **attributes)
  @orientation = orientation
  super(**attributes)
end

Instance Attribute Details

#orientationObject (readonly)

Returns the value of attribute orientation.



19
20
21
# File 'app/components/shadcn/slider/track/component.rb', line 19

def orientation
  @orientation
end

Instance Method Details

#element_attributes(**defaults) ⇒ Object



26
27
28
# File 'app/components/shadcn/slider/track/component.rb', line 26

def element_attributes(**defaults)
  super(**{ "data-orientation" => orientation }.merge(defaults))
end