Easy Shadcn
Components

Card

Card flattens shadcn's Card compound components into a single component: title, description, action, and footer are plain props instead of nested CardHeader / CardTitle / CardFooter structures, and children become the card body.

Default Card
some descriptions
No dividers
No dividers
No dividers
Small Card
using className
  • Size: sm
  • dividers: true
Custom Card Footer
Content-only card without header slots.
Footer divider only

Installation

With the @easy-shadcn namespace configured:

pnpm dlx shadcn@latest add @easy-shadcn/card

Or install via the full URL (zero configuration):

pnpm dlx shadcn@latest add https://easy-shadcn.vercel.app/r/card.json

Props

PropTypeDefaultDescription
titleReactNode-Header title.
descriptionReactNode-Header description rendered below the title.
actionReactNode-Action area pinned to the top-right corner of the header (e.g. a button or menu).
childrenReactNode-Card body, wrapped in CardContent.
footerReactNode-Footer content. The divider and muted background are hidden by default — see dividers.
dividersboolean | { header?: boolean; footer?: boolean }falseShows the header bottom border and/or the footer top border with its muted background.
size"default" | "sm""default"Compact paddings and typography, forwarded to the underlying Card primitive.

Every slot accepts a class override: headerClassName, titleClassName, descriptionClassName, actionClassName, contentClassName, and footerClassName. All other props (className, data-*, event handlers, etc.) are forwarded to the root element.

Notes

  • The header is only rendered when at least one of title, description, or action is present, so a children-only card produces no empty header markup.
  • Slot values follow React's rendering rules: null, undefined, and booleans are treated as absent, while valid falsy nodes such as 0 render normally — handy for stat cards.
  • shadcn's CardFooter ships with border-t bg-muted/50 by default. The Compose layer inverts that default because most footers don't want a separator; opt back in with dividers or dividers={{ footer: true }}.
  • For media cards (full-bleed <img> headers), heterogeneous header layouts, or anything beyond these slots, compose the components/ui/card primitives directly instead of extending this component.

On this page