Sha256: b71008fcec1ed4291cbd4f328cc4678d1e75134bd6deeaf0f378ebc0f402b8ca

Contents?: true

Size: 457 Bytes

Versions: 1

Compression:

Stored size: 457 Bytes

Contents

module Lookbook
  class TabbedContent::Component < Lookbook::Component
    renders_many :sections, ->(ref: nil, **attrs) do
      @section_counter += 1
      ref ||= "tab-#{@section_counter}"
      Lookbook::TabbedContent::Section::Component.new ref: ref, **attrs
    end

    def initialize(**html_attrs)
      @section_counter = 0
      super(**html_attrs)
    end

    protected

    def alpine_component
      "tabbedContentComponent"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lookbook-1.0.0.beta.0 app/components/lookbook/tabbed_content/component.rb