Class: Shadcn::InputOtpComponent::OtpSeparatorComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/shadcn/input_otp_component.rb

Overview

Separator subcomponent (named OtpSeparatorComponent to avoid conflict with standalone SeparatorComponent)

Constant Summary collapse

BASE_CLASSES =
"flex items-center justify-center px-2"

Instance Attribute Summary

Attributes inherited from BaseComponent

#class_name, #data, #html_options

Instance Method Summary collapse

Methods inherited from BaseComponent

#content, #initialize

Methods included from Rails::Helpers::ClassNameHelper

#cn

Constructor Details

This class inherits a constructor from Shadcn::BaseComponent

Instance Method Details

#callObject



176
177
178
179
180
# File 'app/components/shadcn/input_otp_component.rb', line 176

def call
  tag.div(class: merge_classes(BASE_CLASSES), role: "separator", **html_options.merge(build_data)) do
    content.presence || tag.span(class: "text-muted-foreground") { "-" }
  end
end