Class: Fluxbit::BottomNavigationComponent::CTA
- Inherits:
-
Component
- Object
- ViewComponent::Base
- Component
- Fluxbit::BottomNavigationComponent::CTA
- Includes:
- Config::BottomNavigationComponent
- Defined in:
- app/components/fluxbit/bottom_navigation_component.rb
Overview
CTA component for app bar variant
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(**props, &block) ⇒ CTA
constructor
Initializes the CTA component.
Methods inherited from Component
#add, #add_popover_or_tooltip, #anyicon, #element_name, #fx_id, #icon, #options, #popover?, #random_id, #remove_class, #remove_class_from_props, #render_popover_or_tooltip, #target, #tooltip?
Methods included from IconHelpers
#chevron_double_left, #chevron_double_right, #chevron_down, #chevron_left, #chevron_right, #chevron_up, #close_icon, #ellipsis_horizontal, #eye_icon, #eye_slash_icon, #plus_icon
Constructor Details
#initialize(**props, &block) ⇒ CTA
Initializes the CTA component.
228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'app/components/fluxbit/bottom_navigation_component.rb', line 228 def initialize(**props, &block) super(**props, &block) @props = props @parent_config = @props.delete(:parent_config) @href = @props.delete(:href) || "#" @icon = @props.delete(:icon) @tooltip_text = @props.delete(:tooltip_text) add(class: styles[:cta][:button], to: @props, first_element: true) @props[:class] = remove_class(@props.delete(:remove_class) || "", @props[:class]) end |
Instance Method Details
#call ⇒ Object
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'app/components/fluxbit/bottom_navigation_component.rb', line 242 def call setup_data_attributes = tag.(type: "button", **@props) do safe_join([ (@icon ? anyicon(@icon, class: styles[:cta][:icon]) : nil), tag.span(content, class: styles[:item][:sr_only]) ].compact) end if @tooltip_text safe_join([, render_tooltip]) else end end |