Skip to main content

Entity Card

A versatile card component for displaying entity data with support for images, fields, metrics, progress bars, status badges, and tilt animations. Uses generic typing for type-safe entity rendering.

Installation

$ npx shadcn@latest add @orecus/entity-card
Dependencies:
motion
Registry:
@orecus/progress@orecus/color-utils@orecus/use-tilt-animation

Component

Generic entity cards for projects, loans, budgets, and more.

Project Card

Kitchen renovation
In Progress

Kitchen Renovation

Timeline100%
Jan 15, 2024
Jun 30, 2024
$32,500
$45,000
3 contacts
12/28 tasks

Loan Card

Home Mortgage

First National Bank
$285,000
Rate: 4.5%
Monthly: $1,850
Paid Off35%
Mortgage
LN-2024-0042

Budget Card

Expense

Monthly Utilities

$342
$400

Props

PropTypeDefaultDescription
entity*T extends BaseEntityThe entity object to display in the card
title*CardTitle<T>Title configuration with key, render function, and left/right content slots
imageCardImage<T>Image configuration with src, alt, aspectRatio, objectFit
ImageComponentReact.ElementType'img'Image component to use (e.g., next/image for Next.js)
fieldsCardField<T>[]Array of field configurations to display
metricsMetricField<T>[]Metrics displayed in a 2-column grid in the card body
footerMetricsMetricField<T>[]Metrics displayed in the footer section
progressProgressField<T>Progress bar configuration with value, label, placement (top/bottom/footer)
statusStatusField<T>Status badge displayed on the image with value and variant
hoverEffectMaybeEntityValue<T, 'none' | 'lift' | 'scale' | 'tilt'>'none'Hover effect style. Supports static value or entity-derived function.
tiltConfigTiltConfigConfiguration for tilt animation (max angle, perspective, scale, speed). Only used with tilt effects.
hoverBorderMaybeEntityValue<T, boolean>falseWhether border color animates on hover. Supports static value or entity-derived function.
hoverGlowMaybeEntityValue<T, boolean>falseWhether to show gradient glow effect on hover. Supports static value or entity-derived function.
onClick(entity: T) => voidClick handler - makes card interactive with hover effects
typeMaybeEntityValue<T, 'normal' | 'subtle' | 'strong' | 'solid' | 'none'>'normal'Card glass effect variant. Supports static value or entity-derived function.
invertMaybeEntityValue<T, boolean>falseInvert glass overlay approach. Supports static value or entity-derived function.
accentBarMaybeEntityValue<T, 'none' | 'top' | 'bottom'>'none'Gradient accent bar position. Supports static value or entity-derived function.
accentBarVariantMaybeEntityValue<T, 'fade' | 'solid'>'fade'Accent bar gradient style. Supports static value or entity-derived function.
accentColorMaybeEntityValue<T, ThemeColor>'primary'Predefined accent color for accent bar. Supports static value or entity-derived function for dynamic coloring per entity.
accentBarOnHoverMaybeEntityValue<T, boolean>falseWhether accent bar appears only on hover. Supports static value or entity-derived function.
classNamestringAdditional CSS classes for the card
loadingbooleanfalseShows skeleton loading state when true
bentoBentoConfigBento grid configuration. When provided, card uses h-full and flex layout to fill grid cells. Supports optional minHeight class override.