Sha256: 815605cc4fd21a11391526f99cd082790db84568f0142b2d1cd3a0eee58b5a73

Contents?: true

Size: 1020 Bytes

Versions: 4

Compression:

Stored size: 1020 Bytes

Contents

<%= tag.div(component_attributes) do %>
  <% items.each_with_index do |item, index| %>
    <% item.active = index.zero? %>
  <% end %>

  <% if indicators? %>
    <ol class="carousel-indicators">
      <% items.each_with_index do |item, index| %>
        <li data-bs-target="#<%= id %>" data-bs-slide-to="<%= index %>" class="<%= item.active? ? 'active' : '' %>"></li>
      <% end %>
    </ol>
  <% end %>

  <div class="carousel-inner">
    <% items.each_with_index do |item, index| %>
      <%= item %>
    <% end %>
  </div>

  <% if controls? %>
    <a class="carousel-control-prev" href="#<%= id %>" role="button" data-bs-slide="prev">
      <span class="carousel-control-prev-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Previous</span>
    </a>
    <a class="carousel-control-next" href="#<%= id %>" role="button" data-bs-slide="next">
      <span class="carousel-control-next-icon" aria-hidden="true"></span>
      <span class="visually-hidden">Next</span>
    </a>
  <% end %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bs5-0.0.31 app/components/bs5/carousel_component.html.erb
bs5-0.0.30 app/components/bs5/carousel_component.html.erb
bs5-0.0.29 app/components/bs5/carousel_component.html.erb
bs5-0.0.28 app/components/bs5/carousel_component.html.erb