Class: Shadcn::HoverCardContentComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::HoverCardContentComponent
- Defined in:
- app/components/shadcn/hover_card_content_component.rb
Overview
Hover Card Content component
Constant Summary collapse
- BASE_CLASSES =
"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(side: :bottom, align: :center, **options, &block) ⇒ HoverCardContentComponent
constructor
A new instance of HoverCardContentComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(side: :bottom, align: :center, **options, &block) ⇒ HoverCardContentComponent
Returns a new instance of HoverCardContentComponent.
10 11 12 13 14 |
# File 'app/components/shadcn/hover_card_content_component.rb', line 10 def initialize(side: :bottom, align: :center, **, &block) super(**, &block) @side = side @align = align end |
Instance Method Details
#call ⇒ Object
16 17 18 |
# File 'app/components/shadcn/hover_card_content_component.rb', line 16 def call content_tag(:div, content, content_attributes) end |