Class: Shadcn::InputComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::InputComponent
- Defined in:
- app/components/shadcn/input_component.rb
Overview
Input component for form fields Matches shadcn/ui Input component
Constant Summary collapse
- BASE_CLASSES =
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
-
#initialize(type: "text", name: nil, id: nil, value: nil, placeholder: nil, disabled: false, required: false, readonly: false, autofocus: false, autocomplete: nil, pattern: nil, min: nil, max: nil, step: nil, minlength: nil, maxlength: nil, **options) ⇒ InputComponent
constructor
A new instance of InputComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(type: "text", name: nil, id: nil, value: nil, placeholder: nil, disabled: false, required: false, readonly: false, autofocus: false, autocomplete: nil, pattern: nil, min: nil, max: nil, step: nil, minlength: nil, maxlength: nil, **options) ⇒ InputComponent
Returns a new instance of InputComponent.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'app/components/shadcn/input_component.rb', line 39 def initialize( type: "text", name: nil, id: nil, value: nil, placeholder: nil, disabled: false, required: false, readonly: false, autofocus: false, autocomplete: nil, pattern: nil, min: nil, max: nil, step: nil, minlength: nil, maxlength: nil, ** ) super(**) @type = type @name = name @id = id @value = value @placeholder = placeholder @disabled = disabled @required = required @readonly = readonly @autofocus = autofocus @autocomplete = autocomplete @pattern = pattern @min = min @max = max @step = step @minlength = minlength @maxlength = maxlength end |