Class: Irelia::Dropdown::Component

Inherits:
Component
  • Object
show all
Defined in:
app/components/irelia/dropdown/component.rb

Defined Under Namespace

Classes: CustomDropdownTrigger, DropdownItem, DropdownTrigger

Instance Method Summary collapse

Methods inherited from Component

#add_css_classes, after_initialize, #html_options, inherited, run_after_initialize_hooks

Constructor Details

#initialize(**options) ⇒ Component

Returns a new instance of Component.



20
21
22
# File 'app/components/irelia/dropdown/component.rb', line 20

def initialize(**options)
  super
end

Instance Method Details

#variantsObject



11
12
13
14
15
16
17
18
# File 'app/components/irelia/dropdown/component.rb', line 11

def variants
  class_names(
    "irelia-dropdown",
    "irelia-dropdown--default": variant == :default,
    "irelia-dropdown--direction-down": direction == :down,
    "irelia-dropdown--direction-up": direction == :up
  )
end