Class: Shadcn::LabelComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::LabelComponent
- Defined in:
- app/components/shadcn/label_component.rb
Overview
Label component for form fields Matches shadcn/ui Label component
Constant Summary collapse
- BASE_CLASSES =
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
-
#initialize(for: nil, required: false, **options) ⇒ LabelComponent
constructor
A new instance of LabelComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(for: nil, required: false, **options) ⇒ LabelComponent
Returns a new instance of LabelComponent.
21 22 23 24 25 |
# File 'app/components/shadcn/label_component.rb', line 21 def initialize(for: nil, required: false, **) super(**) @for = binding.local_variable_get(:for) @required = required end |