Sha256: fb39bba60ea64d5f113112e7093458f0ad1737dadc1c119c142bd1850be1c8fa

Contents?: true

Size: 1.14 KB

Versions: 4

Compression:

Stored size: 1.14 KB

Contents

<% @tracks = [
  {title: "Total Eclipse of the Heart", artist: "Bonnie Tyler"},
  {title: "I Will Always Love You", artist: "Whitney Houston"},
  {title: "I Wanna Dance with Somebody", artist: "Whitney Houston"},
  {title: "I Will Survive", artist: "Gloria Gaynor"},
  {title: "My Heart Will Go On", artist: "Celine Dion"},
] %>

<%= render_table do %>
  <%= table_head do %>
    <%= table_header "", class: "w-1" %>
    <%= table_header class: "" do %>
      Title
    <% end %>
    <%= table_header "Artist" %>
  <% end %>
  <%= table_body do %>
    <% @tracks.each.with_index do |track, i| %>
      <%= table_row do %>
        <%= table_column do %>
          <svg width="24" height="24" viewBox="0 0 24 24" fill="none"
              stroke="currentColor" stroke-width="2" stroke-linecap="round"
              stroke-linejoin="round">
            <circle cx="12" cy="12" r="10"></circle>
            <polygon points="10 8 16 12 10 16 10 8"></polygon>
          </svg>
        <% end %>
        <%= table_column do %>
          <%= track[:title] %>
        <% end %>
        <%= table_column track[:artist] %>
      <% end %>
    <% end %>
  <% end %>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shadcn-ui-0.0.15 app/views/examples/components/table/code/_preview.erb
shadcn-ui-0.0.14 app/views/examples/components/table/code/_preview.erb
shadcn-ui-0.0.13 app/views/examples/components/table/code/_preview.erb
shadcn-ui-0.0.12 app/views/examples/components/table/code/_preview.erb