Module: BetterUi::General::Components::Container::ContainerHelper

Defined in:
app/helpers/better_ui/general/components/container/container_helper.rb

Instance Method Summary collapse

Instance Method Details

#bui_container(html_content: nil, fluid: false, max_width: :lg, padding: :medium, background: :white, border: false, **html_options, &block) ⇒ String

Genera un container usando BetterUi::General::Container::Component

Examples:

Uso base

bui_container(html_content: "Contenuto del container")

Container fluid

bui_container(
  html_content: "Contenuto full width",
  fluid: true
)

Container con larghezza massima

bui_container(
  html_content: "Contenuto limitato",
  max_width: :lg,
  padding: :large
)

Con contenuto block

bui_container(background: :light) do
  "<div>Il mio contenuto</div>".html_safe
end

Parameters:

  • html_content (String) (defaults to: nil)

    contenuto HTML del container (opzionale)

  • fluid (Boolean) (defaults to: false)

    se il container deve essere fluid (full width)

  • max_width (Symbol) (defaults to: :lg)

    larghezza massima del container (:sm, :md, :lg, :xl, :xxl)

  • padding (Symbol) (defaults to: :medium)

    padding interno (:none, :small, :medium, :large)

  • background (Symbol) (defaults to: :white)

    colore di sfondo (:white, :light, :dark, :transparent)

  • html_options (Hash)

    opzioni HTML aggiuntive

Returns:

  • (String)

    HTML del container renderizzato



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'app/helpers/better_ui/general/components/container/container_helper.rb', line 36

def bui_container(
  html_content: nil,
  fluid: false,
  max_width: :lg,
  padding: :medium,
  background: :white,
  border: false,
  **html_options,
  &block
)
  render BetterUi::General::Container::Component.new(
    html_content: html_content,
    fluid: fluid,
    max_width: max_width,
    padding: padding,
    background: background,
    border: border,
    **html_options
  ), &block
end