app/views/examples/components/badge.html.erb in shadcn-ui-0.0.3 vs app/views/examples/components/badge.html.erb in shadcn-ui-0.0.4
- old
+ new
@@ -3,35 +3,23 @@
<%= render "layouts/documentation/component_header",
title: "Badge",
description: "Displays a badge or a component that looks like a badge." %>
<%= content_for :preview, flush: true do %>
-<div class="w-full mx-auto flex justify-center"><%= render_badge text: "Badge" %></div>
-<div class="w-full mx-auto flex justify-center">
- <%= render_badge text: "Secondary", variant: :secondary %>
-</div>
-<div class="w-full mx-auto flex justify-center">
- <%= render_badge text: "Destructive", variant: :destructive %>
-</div>
-<div class="w-full mx-auto flex justify-center">
- <%= render_badge text: "Outline", variant: :outline %>
-</div>
-<div class="w-full mx-auto flex justify-center">
- <%= render_badge text: "Ghost", variant: :ghost %>
-</div>
+ <%= render_code_preview('badge') %>
<% end %>
<% content_for :code, flush: true do %>
- <%= code_partial("badge/code/preview", :erb) %>
+ <%= code_partial("badge/preview", :erb) %>
<% end %>
<%= render_preview %>
<h2 class="font-heading scroll-m-20 border-b pb-2 text-2xl font-semibold tracking-tight first:mt-0" id="installation">Installation</h2>
<%= code_sample(language: "sh") do %>
rails generate shadcn-ui badge
<% end %>
<h2 class="font-heading mt-12 scroll-m-20 border-b pb-2 mb-2 text-2xl font-semibold tracking-tight first:mt-0" id="usage">Usage</h2>
-<%= code_partial("badge/code/usage", :erb) %>
+<%= code_partial("badge/usage", :erb) %>
<%= render_usage("badge") %>