Class: Shadcn::TabsTriggerComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::TabsTriggerComponent
- Defined in:
- app/components/shadcn/tabs_trigger_component.rb
Overview
Tabs Trigger component
Constant Summary collapse
- BASE_CLASSES =
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(value:, disabled: false, **options) ⇒ TabsTriggerComponent
constructor
A new instance of TabsTriggerComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(value:, disabled: false, **options) ⇒ TabsTriggerComponent
Returns a new instance of TabsTriggerComponent.
10 11 12 13 14 |
# File 'app/components/shadcn/tabs_trigger_component.rb', line 10 def initialize(value:, disabled: false, **) super(**) @value = value @disabled = disabled end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'app/components/shadcn/tabs_trigger_component.rb', line 16 def call content_tag(:button, content, trigger_attributes) end |