Class: Primer::DropdownComponent
- Defined in:
- app/components/primer/dropdown_component.rb
Overview
Dropdowns are lightweight context menus for housing navigation and actions. They’re great for instances where you don’t need the full power (and code) of the select menu.
Constant Summary
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from TestSelectorHelper
TestSelectorHelper::TEST_SELECTOR_TAG
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::InvalidValueError
Instance Method Summary collapse
-
#initialize(overlay: :default, reset: true, summary_classes: "", **system_arguments) ⇒ DropdownComponent
constructor
A new instance of DropdownComponent.
- #render? ⇒ Boolean
Methods included from JoinStyleArgumentsHelper
Methods included from TestSelectorHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean, #silence_deprecations?
Methods included from ClassNameHelper
Constructor Details
#initialize(overlay: :default, reset: true, summary_classes: "", **system_arguments) ⇒ DropdownComponent
Returns a new instance of DropdownComponent.
57 58 59 60 61 62 63 64 65 66 67 |
# File 'app/components/primer/dropdown_component.rb', line 57 def initialize(overlay: :default, reset: true, summary_classes: "", **system_arguments) @system_arguments = system_arguments @system_arguments[:overlay] = @system_arguments[:reset] = reset @system_arguments[:position] = :relative @system_arguments[:classes] = class_names( @system_arguments[:classes], "dropdown" ) @summary_classes = summary_classes end |
Instance Method Details
#render? ⇒ Boolean
69 70 71 |
# File 'app/components/primer/dropdown_component.rb', line 69 def render? .present? && .present? end |