Class: UI::InputOtpGroup

Inherits:
Phlex::HTML
  • Object
show all
Includes:
InputOtpGroupBehavior
Defined in:
app/components/ui/input_otp_group.rb

Overview

Group - Phlex implementation

Container for grouping OTP input slots together visually.

Examples:

render UI::Group.new do
  render UI::Slot.new(index: 0)
  render UI::Slot.new(index: 1)
end

Instance Method Summary collapse

Methods included from InputOtpGroupBehavior

#input_otp_group_classes, #input_otp_group_html_attributes

Constructor Details

#initialize(classes: "", **attributes) ⇒ InputOtpGroup

Returns a new instance of InputOtpGroup.

Parameters:

  • classes (String) (defaults to: "")

    Additional CSS classes

  • attributes (Hash)

    Additional HTML attributes



17
18
19
20
# File 'app/components/ui/input_otp_group.rb', line 17

def initialize(classes: "", **attributes)
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template(&block) ⇒ Object



22
23
24
# File 'app/components/ui/input_otp_group.rb', line 22

def view_template(&block)
  div(**input_otp_group_html_attributes.merge(@attributes), &block)
end