Class: NfgUi::Components::Elements::DropdownToggle
- Inherits:
-
Bootstrap::Components::DropdownToggle
- Object
- Bootstrap::Components::Base
- Bootstrap::Components::DropdownToggle
- NfgUi::Components::Elements::DropdownToggle
- Includes:
- Traits::DropdownToggle, Traits::Size, Traits::Theme, Utilities::Describable, Utilities::Iconable, Utilities::LeftIconable, Utilities::Renderable, Utilities::Traitable
- Defined in:
- lib/nfg_ui/components/elements/dropdown_toggle.rb
Overview
Badge doesn’t have any customizations unique to the design system yet As such, the NFG UI badge is simply a bootstrap badge behind the scenes. Traits will eventually be connected here.
Constant Summary
Constants included from Traits::Theme
Traits::Theme::COLOR_TRAITS, Traits::Theme::TRAITS
Constants included from Traits::Size
Constants included from Traits::DropdownToggle
Traits::DropdownToggle::TRAITS
Constants included from Traits
Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES
Instance Attribute Summary
Attributes included from Bootstrap::Utilities::Wrappable
Attributes inherited from Bootstrap::Components::Base
#body, #options, #view_context
Instance Method Summary collapse
Methods included from Traits::Theme
#danger_trait, #dark_trait, #info_trait, #light_trait, #outlined_trait, #primary_trait, #secondary_trait, #success_trait, #warning_trait, #white_trait
Methods included from Traits::Size
#lg_trait, #md_trait, #sm_trait, #xl_trait
Methods included from Traits::DropdownToggle
Methods included from Utilities::Renderable
Methods included from Utilities::Describable
Methods included from Utilities::Traitable
Methods included from Utilities::LeftIconable
Methods inherited from Bootstrap::Components::DropdownToggle
#component_family, #data, #href, #nav_link, #offset, #split, #theme
Methods included from Bootstrap::Utilities::Sizable
Methods included from Bootstrap::Utilities::Wrappable
Methods inherited from Bootstrap::Components::Base
#component_family, #data, #href, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#icon ⇒ Object
20 21 22 |
# File 'lib/nfg_ui/components/elements/dropdown_toggle.rb', line 20 def icon .fetch(:icon, 'caret-down') end |
#render ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/nfg_ui/components/elements/dropdown_toggle.rb', line 24 def render NfgUi::Components::Elements::Button.new({ as: as, theme: theme, **, remove_component_css_classes: nav_link, icon: icon }, view_context).render do capture do if left_icon concat(NfgUi::Components::Foundations::Icon.new({ traits: [left_icon], class: NfgUi::Components::Foundations::Icon::LEFT_ICON_SPACER_CSS_CLASS }, view_context).render) end concat(block_given? ? yield : body) end end end |