Class: PhlexKit::Attachment
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Attachment
- Defined in:
- app/components/phlex_kit/attachment/attachment.rb
Overview
File chip, ported from shadcn/ui's Attachment (an AI-chat-era addition, not
in ruby_ui): a bordered row of AttachmentMedia (icon or image preview) +
AttachmentContent(AttachmentTitle + AttachmentDescription) +
AttachmentActions(AttachmentAction — e.g. a remove ×).
.pk-attachment* (attachment.css).
Instance Method Summary collapse
-
#initialize(**attrs) ⇒ Attachment
constructor
A new instance of Attachment.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(**attrs) ⇒ Attachment
Returns a new instance of Attachment.
8 9 10 |
# File 'app/components/phlex_kit/attachment/attachment.rb', line 8 def initialize(**attrs) @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
12 13 14 |
# File 'app/components/phlex_kit/attachment/attachment.rb', line 12 def view_template(&) div(**mix({ class: "pk-attachment" }, @attrs), &) end |