Sha256: bee0ee183acad4c7a29bd17b6989b6f02e461f803d532f13718e77d6ce178455
Contents?: true
Size: 859 Bytes
Versions: 22
Compression:
Stored size: 859 Bytes
Contents
module Spina module UserInterface class DropdownComponent < ApplicationComponent renders_one :button, "ButtonComponent" renders_one :menu, "MenuComponent" class ButtonComponent < ApplicationComponent attr_reader :classes def initialize(classes:) @classes = classes end def call content_tag :button, content, {type: 'button', class: classes, data: {action: "reveal#toggle"}} end end class MenuComponent < ApplicationComponent def call content_tag :div, content, {class: "origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg border border-gray-200 z-20 rounded-md bg-white shadow-xs py-1", hidden: true, data: {reveal: true, transition: true}} end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems