Class: PhlexKit::DropdownMenuSeparator
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::DropdownMenuSeparator
- Defined in:
- app/components/phlex_kit/dropdown_menu/dropdown_menu_separator.rb
Overview
A horizontal divider between groups of PhlexKit::DropdownMenuItems. See dropdown_menu.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ DropdownMenuSeparator
constructor
A new instance of DropdownMenuSeparator.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ DropdownMenuSeparator
Returns a new instance of DropdownMenuSeparator.
4 5 6 |
# File 'app/components/phlex_kit/dropdown_menu/dropdown_menu_separator.rb', line 4 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'app/components/phlex_kit/dropdown_menu/dropdown_menu_separator.rb', line 8 def view_template base = { class: "pk-dropdown-menu-separator" } # Defaults only when the caller didn't supply their own — `mix` fuses, # and aria_key_set? covers the aria: hash spelling the flat key missed. base[:role] = "separator" unless attr_set?(:role) base[:"aria-orientation"] = "horizontal" unless aria_key_set?(:orientation) div(**mix(base, @attrs)) end |