Class: Shadcn::ToastActionComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::ToastActionComponent
- Defined in:
- app/components/shadcn/toast_action_component.rb
Overview
Toast Action component
Constant Summary collapse
- BASE_CLASSES =
"inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(alt_text:, **options, &block) ⇒ ToastActionComponent
constructor
A new instance of ToastActionComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(alt_text:, **options, &block) ⇒ ToastActionComponent
Returns a new instance of ToastActionComponent.
9 10 11 12 |
# File 'app/components/shadcn/toast_action_component.rb', line 9 def initialize(alt_text:, **, &block) super(**, &block) @alt_text = alt_text end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'app/components/shadcn/toast_action_component.rb', line 14 def call content_tag(:div, content, class: merge_classes(BASE_CLASSES), "aria-label": @alt_text) end |