Class: RubyUI::CommandDialogContent
- Defined in:
- lib/ruby_ui/command/command_dialog_content.rb
Constant Summary collapse
- SIZES =
{ xs: "max-w-sm", sm: "max-w-md", md: "max-w-lg", lg: "max-w-2xl", xl: "max-w-4xl", full: "max-w-full" }
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(size: :md, **attrs) ⇒ CommandDialogContent
constructor
A new instance of CommandDialogContent.
- #view_template(&block) ⇒ Object
Constructor Details
#initialize(size: :md, **attrs) ⇒ CommandDialogContent
Returns a new instance of CommandDialogContent.
14 15 16 17 |
# File 'lib/ruby_ui/command/command_dialog_content.rb', line 14 def initialize(size: :md, **attrs) @size = size super(**attrs) end |
Instance Method Details
#view_template(&block) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/ruby_ui/command/command_dialog_content.rb', line 19 def view_template(&block) template(data: {ruby_ui__command_target: "content"}) do div(data: {controller: "ruby-ui--command"}) do backdrop div(**attrs, &block) end end end |