Sha256: 5b48cc96748d075f1b98c9b944b2116b282703c7d5cf2a5f184aa89d5addb5ab
Contents?: true
Size: 689 Bytes
Versions: 32
Compression:
Stored size: 689 Bytes
Contents
module Lookbook class Tabs::Component < Lookbook::BaseComponent renders_many :tabs, ->(**attrs) do @tab_counter += 1 attrs[:name] ||= "tab-#{@tab_counter}" attrs[:position] ||= @tab_counter attrs[:theme] ||= @theme dropdown_tab(**attrs) Lookbook::Tabs::Tab::Component.new(**attrs) end renders_many :dropdown_tabs, ->(name:, **attrs) do Lookbook::Tabs::DropdownTab::Component.new(name: "dropdown-#{name}", **attrs) end def initialize(theme: :toolbar, **html_attrs) @theme = theme @tab_counter = 0 super(**html_attrs) end protected def alpine_component "tabsComponent" end end end
Version data entries
32 entries across 32 versions & 1 rubygems