Class: Shadcn::SelectItemComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::SelectItemComponent
- Defined in:
- app/components/shadcn/select_item_component.rb
Overview
Select Item component
Constant Summary collapse
- BASE_CLASSES =
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(value:, disabled: false, **options, &block) ⇒ SelectItemComponent
constructor
A new instance of SelectItemComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(value:, disabled: false, **options, &block) ⇒ SelectItemComponent
Returns a new instance of SelectItemComponent.
10 11 12 13 14 |
# File 'app/components/shadcn/select_item_component.rb', line 10 def initialize(value:, disabled: false, **, &block) super(**, &block) @value = value @disabled = disabled end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'app/components/shadcn/select_item_component.rb', line 16 def call content_tag(:div, item_content, item_attributes) end |