Module: BetterUi::General::Components::Divider::DividerHelper

Included in:
BetterUi::General::Components::Divider
Defined in:
app/helpers/better_ui/general/components/divider/divider_helper.rb

Instance Method Summary collapse

Instance Method Details

#bui_divider(theme: :white, orientation: :horizontal, style: :solid, size: :medium, label: nil, height: nil, classes: nil, **html_options) ⇒ String

Genera un divider usando BetterUi::General::Divider::Component

Examples:

Uso base

bui_divider
bui_divider(theme: :blue, size: :thick)

Con label

bui_divider(label: "Oppure", theme: :red)

Divider verticale

bui_divider(orientation: :vertical, height: "100px", theme: :green)

Con opzioni avanzate

bui_divider(
  theme: :violet,
  orientation: :horizontal,
  style: :dashed,
  size: :medium,
  label: "Sezione",
  classes: "my-8",
  id: "main-divider"
)

Parameters:

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

    tema del divider (:default, :white, etc.)

  • orientation (Symbol) (defaults to: :horizontal)

    orientamento del divider (:horizontal, :vertical)

  • style (Symbol) (defaults to: :solid)

    stile della linea (:solid, :dashed, :dotted, :double)

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

    dimensione della linea (:thin, :medium, :thick)

  • label (String) (defaults to: nil)

    testo opzionale da mostrare al centro del divider

  • height (String) (defaults to: nil)

    altezza per divider verticale (es. “100px”, “100%”)

  • classes (String) (defaults to: nil)

    classi CSS aggiuntive

  • html_options (Hash)

    opzioni HTML per il container

Returns:

  • (String)

    HTML del divider renderizzato



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'app/helpers/better_ui/general/components/divider/divider_helper.rb', line 38

def bui_divider(
  theme: :white,
  orientation: :horizontal,
  style: :solid,
  size: :medium,
  label: nil,
  height: nil,
  classes: nil,
  **html_options
)
  render BetterUi::General::Divider::Component.new(
    theme: theme,
    orientation: orientation,
    style: style,
    size: size,
    label: label,
    height: height,
    classes: classes,
    **html_options
  )
end