module NfgUi::Components::Traits::Button

Access to pre-designed Button traits

Constants

TRAITS

Public Instance Methods

block_trait() click to toggle source
# File lib/nfg_ui/components/traits/button.rb, line 19
def block_trait
  options[:block] = true
end
close_trait() click to toggle source
# File lib/nfg_ui/components/traits/button.rb, line 23
def close_trait
  self.as = :button
  data[:dismiss] = options.delete(:dismiss)
  options[:theme] = nil
  @css_classes = 'close'
  @body = '×'.html_safe
  assistive_html_attributes.merge!(aria: { label: 'close' })
end
outlined_trait() click to toggle source
# File lib/nfg_ui/components/traits/button.rb, line 41
def outlined_trait
  options[:outlined] = true
end
remote_trait() click to toggle source
# File lib/nfg_ui/components/traits/button.rb, line 32
def remote_trait
  options[:remote] = true
end
submit_trait() click to toggle source
# File lib/nfg_ui/components/traits/button.rb, line 36
def submit_trait
  self.as = :button
  options[:type] = 'submit'
end