Class: Shadcn::CardComponent

Inherits:
BaseComponent show all
Defined in:
app/components/shadcn/card_component.rb

Overview

Card component with header, content, and footer slots Matches shadcn/ui Card component

Examples:

Basic card

<%= render Shadcn::CardComponent.new do |card| %>
  <% card.with_header do %>
    <% card.with_title { "Card Title" } %>
    <% card.with_description { "Card description" } %>
  <% end %>
  <% card.with_content do %>
    Card content goes here
  <% end %>
  <% card.with_footer do %>
    <button>Action</button>
  <% end %>
<% end %>

Constant Summary collapse

BASE_CLASSES =
"rounded-xl border bg-card text-card-foreground shadow"

Instance Attribute Summary

Attributes inherited from BaseComponent

#class_name, #data, #html_options

Method Summary

Methods inherited from BaseComponent

#content, #initialize

Methods included from Rails::Helpers::ClassNameHelper

#cn

Constructor Details

This class inherits a constructor from Shadcn::BaseComponent