Class: Yattho::Alpha::NavList
- Defined in:
- app/components/yattho/alpha/nav_list.rb,
app/components/yattho/alpha/nav_list/item.rb,
app/components/yattho/alpha/nav_list/section.rb
Overview
‘NavList` provides a simple way to render side navigation, i.e. navigation that appears to the left or right side of some main content. Each section in a nav list is a list of links.
Nav list sections can contain sub items. Rather than navigating to a URL, sections with sub items expand and collapse on click. To indicate this functionality, the section will automatically render with a trailing chevron icon that changes direction when the section expands and collapses.
Nav list items appear visually active when selected. Each nav item must have one or more ID values that determine which item will appear selected. Use the ‘selected_item_id` argument to select the appropriate item.
Defined Under Namespace
Constant Summary
Constants inherited from Component
Component::INVALID_ARIA_LABEL_TAGS
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(selected_item_id: nil, **system_arguments) ⇒ NavList
constructor
A new instance of NavList.
Methods inherited from Component
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(selected_item_id: nil, **system_arguments) ⇒ NavList
Returns a new instance of NavList.
102 103 104 105 106 107 108 109 |
# File 'app/components/yattho/alpha/nav_list.rb', line 102 def initialize(selected_item_id: nil, **system_arguments) @system_arguments = system_arguments @system_arguments[:classes] = class_names( @system_arguments[:classes], "ActionListWrap" ) @selected_item_id = selected_item_id end |