Class: PhlexKit::SheetClose
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::SheetClose
- Defined in:
- app/components/phlex_kit/sheet/sheet_close.rb
Overview
Wraps any element (typically a Button) so clicking it closes the enclosing sheet, mirroring shadcn/ui's SheetClose. See sheet.rb.
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ SheetClose
constructor
A new instance of SheetClose.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ SheetClose
Returns a new instance of SheetClose.
5 |
# File 'app/components/phlex_kit/sheet/sheet_close.rb', line 5 def initialize(**attrs) = (@attrs = attrs) |
Instance Method Details
#view_template ⇒ Object
6 7 8 |
# File 'app/components/phlex_kit/sheet/sheet_close.rb', line 6 def view_template(&) span(**mix({ style: "display: contents", data: { action: "click->phlex-kit--sheet-content#close" } }, @attrs), &) end |