class Bootstrap4RailsComponents::Bootstrap::Components::Navbar

Bootstrap Navbar Component getbootstrap.com/docs/4.1/components/navbar/

Public Instance Methods

component_family() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 12
def component_family
  :navbar
end
dark() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 24
def dark
  options.fetch(:dark, nil)
end
expand() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 16
def expand
  options.fetch(:expand, :lg)
end
fixed() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 32
def fixed
  options.fetch(:fixed, nil)
end
light() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 20
def light
  options.fetch(:light, nil)
end
sticky() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 28
def sticky
  options.fetch(:sticky, nil)
end

Private Instance Methods

assistive_html_attributes() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 53
def assistive_html_attributes
  as == :nav ? super : super.merge!(role: 'navigation')
end
base_element() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 38
def base_element
  as
end
css_classes() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 42
def css_classes
  [
    super,
    ("#{component_css_class}-expand-#{expand}" unless expand.nil?),
    dark_or_light_navbar_css_class,
    ('sticky-top' if sticky == :top),
    ('fixed-bottom' if fixed == :bottom),
    ('fixed-top' if fixed == :top),
  ].join(' ').squish
end
dark_or_light_navbar_css_class() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 65
def dark_or_light_navbar_css_class
  if dark
    'navbar-dark'
  elsif light
    'navbar-light'
  else
    dark_themes.include?(theme) ? 'navbar-dark' : 'navbar-light'
  end
end
dark_themes() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 87
def dark_themes
  %i[primary secondary success danger warning info dark]
end
default_html_wrapper_element() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 57
def default_html_wrapper_element
  :nav
end
default_theme() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 75
def default_theme
  :light
end
non_html_attribute_options() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 79
def non_html_attribute_options
  super.push(:dark,
             :expand,
             :right,
             :left,
             :light)
end
outlineable?() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 91
def outlineable?
  false
end
theme_css_class_prefix() click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/navbar.rb, line 61
def theme_css_class_prefix
  'bg-'
end