Class: RubyUI::SelectContent

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_ui/select/select_content.rb

Constant Summary

Constants inherited from Base

Base::TAILWIND_MERGER

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Constructor Details

#initialize(**attrs) ⇒ SelectContent

Returns a new instance of SelectContent.



5
6
7
8
# File 'lib/ruby_ui/select/select_content.rb', line 5

def initialize(**attrs)
  @id = "content#{SecureRandom.hex(4)}"
  super
end

Instance Method Details

#view_template(&block) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/ruby_ui/select/select_content.rb', line 10

def view_template(&block)
  div(**attrs) do
    div(
      class: "max-h-96 w-full text-wrap overflow-auto rounded-md border bg-background p-1 text-foreground shadow-md animate-out group-data-[ruby-ui--select-open-value=true]/select:animate-in fade-out-0 group-data-[ruby-ui--select-open-value=true]/select:fade-in-0 zoom-out-95 group-data-[ruby-ui--select-open-value=true]/select:zoom-in-95 slide-in-from-top-2", &block
    )
  end
end