Module: NfgUi::Components::Traits::Icon
- Includes:
- Utilities::Traits::TraitUtilities
- Included in:
- Foundations::Icon
- Defined in:
- lib/nfg_ui/components/traits/icon.rb
Overview
Access to pre-designed Icon traits
Constant Summary collapse
- TRAITS =
%i[loader tip].freeze
Instance Method Summary collapse
- #loader_trait ⇒ Object
-
#tip_trait ⇒ Object
The defacto “(?)” tip icon Usage: ui.nfg :icon, :tip, tooltip: ‘The tip’.
Instance Method Details
#loader_trait ⇒ Object
12 13 14 |
# File 'lib/nfg_ui/components/traits/icon.rb', line 12 def loader_trait [:icon] = 'spinner spin fw' end |
#tip_trait ⇒ Object
The defacto “(?)” tip icon Usage: ui.nfg :icon, :tip, tooltip: ‘The tip’
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/nfg_ui/components/traits/icon.rb', line 19 def tip_trait maybe_update_option(:icon, value: NfgUi::DEFAULT_TIP_ICON) maybe_update_option(:theme, value: NfgUi::DEFAULT_TIP_THEME) if [:text].present? maybe_update_option(:right, value: true) [:class] += ' fa-fw' end end |