Class: Shadcn::DrawerContentComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::DrawerContentComponent
- Defined in:
- app/components/shadcn/drawer_content_component.rb
Overview
Drawer Content component
Constant Summary collapse
- OVERLAY_CLASSES =
"fixed inset-0 z-50 bg-black/80"- CONTENT_CLASSES =
{ bottom: "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background", top: "fixed inset-x-0 top-0 z-50 mb-24 flex h-auto flex-col rounded-b-[10px] border bg-background", left: "fixed inset-y-0 left-0 z-50 h-full w-3/4 max-w-sm flex flex-col border-r bg-background", right: "fixed inset-y-0 right-0 z-50 h-full w-3/4 max-w-sm flex flex-col border-l bg-background" }.freeze
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(direction: :bottom, **options, &block) ⇒ DrawerContentComponent
constructor
A new instance of DrawerContentComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(direction: :bottom, **options, &block) ⇒ DrawerContentComponent
Returns a new instance of DrawerContentComponent.
22 23 24 25 |
# File 'app/components/shadcn/drawer_content_component.rb', line 22 def initialize(direction: :bottom, **, &block) super(**, &block) @direction = direction end |
Instance Method Details
#call ⇒ Object
27 28 29 |
# File 'app/components/shadcn/drawer_content_component.rb', line 27 def call content_tag(:template, content_wrapper, { "data-shadcn--drawer-target": "template" }) end |