Class: BetterUi::Forms::PasswordInputComponent
- Inherits:
-
TextInputComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- BaseComponent
- TextInputComponent
- BetterUi::Forms::PasswordInputComponent
- Defined in:
- app/components/better_ui/forms/password_input_component.rb
Overview
The suffix_icon slot from TextInputComponent is not available in PasswordInputComponent as the suffix position is occupied by the visibility toggle button.
A password input component with visibility toggle functionality.
This component extends TextInputComponent to provide a password input field with a toggle button that allows users to show or hide the password text. The toggle button displays an eye icon when the password is hidden and an eye-slash icon when the password is visible.
The component inherits all features from TextInputComponent including labels, hints, errors, validation states, sizes, and the prefix_icon slot. The suffix position is reserved for the password visibility toggle button.
Constant Summary
Constants inherited from TextInputComponent
Constants inherited from BaseComponent
Constants inherited from ApplicationComponent
ApplicationComponent::SHADOWS, ApplicationComponent::VARIANTS, ApplicationComponent::VARIANT_BODY_DIVIDE, ApplicationComponent::VARIANT_DIVIDE, ApplicationComponent::VARIANT_HEADER_BG, ApplicationComponent::VARIANT_HEADER_TEXT, ApplicationComponent::VARIANT_HIGHLIGHTED, ApplicationComponent::VARIANT_HOVERABLE, ApplicationComponent::VARIANT_RING, ApplicationComponent::VARIANT_SORT_ICON, ApplicationComponent::VARIANT_STRIPED
Instance Method Summary collapse
-
#initialize(name:, value: nil, label: nil, hint: nil, placeholder: nil, size: :md, disabled: false, readonly: false, required: false, errors: nil, container_classes: nil, label_classes: nil, input_classes: nil, hint_classes: nil, error_classes: nil, **options) ⇒ PasswordInputComponent
constructor
Initializes a new password input component.
Methods inherited from TextInputComponent
#with_prefix_icon, #with_suffix_icon
Methods inherited from BaseComponent
Constructor Details
#initialize(name:, value: nil, label: nil, hint: nil, placeholder: nil, size: :md, disabled: false, readonly: false, required: false, errors: nil, container_classes: nil, label_classes: nil, input_classes: nil, hint_classes: nil, error_classes: nil, **options) ⇒ PasswordInputComponent
Initializes a new password input component.
All parameters are passed to TextInputComponent#initialize. See the parent class for detailed parameter descriptions.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'app/components/better_ui/forms/password_input_component.rb', line 71 def initialize( name:, value: nil, label: nil, hint: nil, placeholder: nil, size: :md, disabled: false, readonly: false, required: false, errors: nil, container_classes: nil, label_classes: nil, input_classes: nil, hint_classes: nil, error_classes: nil, ** ) super( name: name, value: value, label: label, hint: hint, placeholder: placeholder, size: size, disabled: disabled, readonly: readonly, required: required, errors: errors, container_classes: container_classes, label_classes: label_classes, input_classes: input_classes, hint_classes: hint_classes, error_classes: error_classes, ** ) end |