Class: Primer::DropdownComponent
- Includes:
- ViewComponent::SlotableV2
- 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 inherited from Component
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 inherited from Component
Methods included from ViewHelper
Methods included from JoinStyleArgumentsHelper
Methods included from FetchOrFallbackHelper
#fetch_or_fallback, #fetch_or_fallback_boolean
Methods included from ClassNameHelper
Constructor Details
#initialize(overlay: :default, reset: true, summary_classes: "", **system_arguments) ⇒ DropdownComponent
Returns a new instance of DropdownComponent.
59 60 61 62 63 64 65 66 67 68 69 |
# File 'app/components/primer/dropdown_component.rb', line 59 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
71 72 73 |
# File 'app/components/primer/dropdown_component.rb', line 71 def render? .present? && .present? end |