app/views/examples/components/tooltip.html.erb in shadcn-ui-0.0.3 vs app/views/examples/components/tooltip.html.erb in shadcn-ui-0.0.4

- old
+ new

@@ -1,23 +1,26 @@ <%= render_component_header title: "Tooltip", description: "A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it." %> <% content_for :preview, flush: true do %> - <%= render_tooltip do %> - <%= tooltip_trigger do %> - <%= render_button "Hover", variant: :outline %> - <% end %> - <%= tooltip_content do %> - <div class="grid gap-2"> - <div class="space-y-2"> - <p class="text-sm text-muted-foreground">More will be revealed.</p> - </div> - </div> - <% end %> - <% end %> +<div class="w-full flex justify-center"> + <%= render_code_preview('tooltip') %> +</div> <% end %> <% content_for :code, flush: true do %> - +<div class="w-full flex justify-center"> + <%= code_partial("tooltip/preview", :erb) %> +</div> <% 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 tooltip +<% 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("tooltip/usage", :erb) %> + +<%= render_usage("tooltip") %>