Class: Protos::Drawer
- Inherits:
-
Component
show all
- Defined in:
- lib/protos/drawer.rb,
lib/protos/drawer/side.rb,
lib/protos/drawer/content.rb,
lib/protos/drawer/trigger.rb
Defined Under Namespace
Classes: Content, Side, Trigger
Instance Method Summary
collapse
Methods inherited from Component
#initialize
Instance Method Details
#content ⇒ Object
32
|
# File 'lib/protos/drawer.rb', line 32
def content(...) = render Content.new(...)
|
#side ⇒ Object
34
|
# File 'lib/protos/drawer.rb', line 34
def side(*, **, &) = render Side.new(*, input_id: @id, **, &)
|
#trigger ⇒ Object
36
|
# File 'lib/protos/drawer.rb', line 36
def trigger(*, **, &) = render Trigger.new(*, input_id: @id, **, &)
|
#view_template ⇒ Object
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/protos/drawer.rb', line 19
def view_template
div(**attrs) do
input(
id: @id,
type: :checkbox,
class: css[:toggle],
autocomplete: :off,
form: ""
)
yield if block_given?
end
end
|