Class: Shadcn::TextareaComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::TextareaComponent
- Defined in:
- app/components/shadcn/textarea_component.rb
Overview
Textarea component for multi-line text input Matches shadcn/ui Textarea component
Constant Summary collapse
- BASE_CLASSES =
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm 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(name: nil, id: nil, value: nil, placeholder: nil, rows: 3, cols: nil, disabled: false, required: false, readonly: false, autofocus: false, minlength: nil, maxlength: nil, **options) ⇒ TextareaComponent
constructor
A new instance of TextareaComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(name: nil, id: nil, value: nil, placeholder: nil, rows: 3, cols: nil, disabled: false, required: false, readonly: false, autofocus: false, minlength: nil, maxlength: nil, **options) ⇒ TextareaComponent
Returns a new instance of TextareaComponent.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'app/components/shadcn/textarea_component.rb', line 28 def initialize( name: nil, id: nil, value: nil, placeholder: nil, rows: 3, cols: nil, disabled: false, required: false, readonly: false, autofocus: false, minlength: nil, maxlength: nil, ** ) super(**) @name = name @id = id @value = value @placeholder = placeholder @rows = rows @cols = cols @disabled = disabled @required = required @readonly = readonly @autofocus = autofocus @minlength = minlength @maxlength = maxlength end |