Module: BetterUi::Application::Components::Navbar::NavbarHelper

Included in:
BetterUi::Application::Components::Navbar
Defined in:
app/helpers/better_ui/application/components/navbar/navbar_helper.rb

Instance Method Summary collapse

Instance Method Details

#bui_navbar(theme: :default, position: :top, height: :md, shadow: :sm, border: true, brand: {}, breadcrumb: {}, navigation_items: [], actions: [], classes: nil, &block) ⇒ String

Helper per creare la navbar dell’applicazione

Parameters:

  • theme (Symbol) (defaults to: :default)

    Tema colori (:default, :dark, :light), default :default

  • position (Symbol) (defaults to: :top)

    Posizione della navbar (:top, :fixed_top, :sticky_top), default :top

  • height (Symbol) (defaults to: :md)

    Altezza della navbar (:sm, :md, :lg), default :md

  • shadow (Symbol) (defaults to: :sm)

    Tipo di ombra (:none, :sm, :md, :lg, :xl), default :sm

  • border (Boolean) (defaults to: true)

    Se mostrare il bordo inferiore, default true

  • brand (Hash) (defaults to: {})

    Configurazione brand (logo, title, href)

  • breadcrumb (Hash) (defaults to: {})

    Configurazione breadcrumb (items, separator, theme)

  • navigation_items (Array) (defaults to: [])

    Array di elementi di navigazione centrali

  • actions (Array) (defaults to: [])

    Array di azioni/pulsanti a destra

  • classes (String) (defaults to: nil)

    Classi CSS aggiuntive

  • block (Proc)

    Blocco contenente contenuto aggiuntivo della navbar

Returns:

  • (String)

    HTML del componente navbar



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'app/helpers/better_ui/application/components/navbar/navbar_helper.rb', line 21

def bui_navbar(
  theme: :default,
  position: :top,
  height: :md,
  shadow: :sm,
  border: true,
  brand: {},
  breadcrumb: {},
  navigation_items: [],
  actions: [],
  classes: nil,
  &block
)
  render BetterUi::Application::Navbar::Component.new(
    theme: theme,
    position: position,
    height: height,
    shadow: shadow,
    border: border,
    brand: brand,
    breadcrumb: breadcrumb,
    navigation_items: navigation_items,
    actions: actions,
    classes: classes
  ), &block
end