Class: UI::InputOtpSeparatorComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::InputOtpSeparatorComponent
- Includes:
- InputOtpSeparatorBehavior
- Defined in:
- app/view_components/ui/input_otp_separator_component.rb
Overview
SeparatorComponent - ViewComponent implementation
Visual divider between OTP input groups.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ InputOtpSeparatorComponent
constructor
A new instance of InputOtpSeparatorComponent.
Methods included from InputOtpSeparatorBehavior
#input_otp_separator_classes, #input_otp_separator_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ InputOtpSeparatorComponent
Returns a new instance of InputOtpSeparatorComponent.
14 15 16 17 |
# File 'app/view_components/ui/input_otp_separator_component.rb', line 14 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/view_components/ui/input_otp_separator_component.rb', line 19 def call attrs = input_otp_separator_html_attributes content_tag :div, **attrs.merge(@attributes) do # Render dot or dash separator content_tag :svg, nil, xmlns: "http://www.w3.org/2000/svg", width: "15", height: "15", viewBox: "0 0 15 15", fill: "none", class: "size-4 opacity-50" do tag.rect(x: "4", y: "7", width: "7", height: "1", fill: "currentColor", rx: "0.5") end end end |