Class: PhlexKit::Drawer
- Inherits:
-
BaseComponent
- Object
- Phlex::HTML
- BaseComponent
- PhlexKit::Drawer
- Defined in:
- app/components/phlex_kit/drawer/drawer.rb
Overview
Bottom drawer, ported from shadcn/ui's Drawer. The vaul dependency is replaced by reusing the kit's sheet machinery — the phlex-kit--sheet controller clones DrawerContent's into — with drawer chrome (bottom sheet, grab handle, slide-up animation). Compose Drawer > DrawerTrigger + DrawerContent(DrawerHeader(DrawerTitle + DrawerDescription)
- body + DrawerFooter [+ DrawerClose]).
.pk-drawer*(drawer.css).
Instance Method Summary collapse
-
#initialize(open: false, **attrs) ⇒ Drawer
constructor
A new instance of Drawer.
- #view_template ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(open: false, **attrs) ⇒ Drawer
Returns a new instance of Drawer.
9 10 11 12 |
# File 'app/components/phlex_kit/drawer/drawer.rb', line 9 def initialize(open: false, **attrs) @open = open @attrs = attrs end |
Instance Method Details
#view_template ⇒ Object
14 15 16 |
# File 'app/components/phlex_kit/drawer/drawer.rb', line 14 def view_template(&) div(**mix({ data: { controller: "phlex-kit--sheet", phlex_kit__sheet_open_value: @open } }, @attrs), &) end |