Class: Charming::Components::Modal

Inherits:
Charming::Component show all
Defined in:
lib/charming/components/modal.rb

Instance Method Summary collapse

Methods inherited from View

#focused?, #layout_assigns

Constructor Details

#initialize(content:, title: nil, help: nil, width: 52, style: nil, theme: nil) ⇒ Modal

Returns a new instance of Modal.



6
7
8
9
10
11
12
13
# File 'lib/charming/components/modal.rb', line 6

def initialize(content:, title: nil, help: nil, width: 52, style: nil, theme: nil)
  super(theme: theme)
  @content = content
  @title = title
  @help = help
  @width = width
  @style = style
end

Instance Method Details

#renderObject



15
16
17
# File 'lib/charming/components/modal.rb', line 15

def render
  box(column(*lines, gap: 1), style: modal_style)
end