module Coco module App module Blocks class NavDrawer < Coco::Component renders_many :items, types: { html: ->(&block) { block.call }, divider: ->(&block) { tag.div class: "nav-drawer-divider" }, heading: ->(text, **kwargs, &block) do tag.h4(text, class: "nav-drawer-heading") end, button: ->(*args, **kwargs, &block) do coco_button(*args, **kwargs, theme: nil, size: :md, fit: :full, class: "nav-drawer-button", &block) end } def with_divider(...) with_item_divider(...) end def with_html(...) with_item_html(...) end def with_button(...) with_item_button(...) end def with_heading(...) with_item_heading(...) end end end end end