page ProductCardcomponent { seo { title = "ProductCard component" description = "Reusable product card component." } view {
W WRNexusJS
content component

ProductCard

Reusable product card component.

@wrnexus/ui 0.3.17 props0 slots0 events

Usage

Components are auto-discovered. Use the component directly in any .wrn view:

<ProductCard
  eyebrow="Product"
  title="Product name"
  description="description"
  href="#"
  actionLabel="Learn more"
/>

Legacy mount name: data-component="ProductCard".

Props and attributes

PropTypeRequirementDefault
eyebrowstringOptional"Product"
titlestringOptional"Product name"
descriptionstringOptional""
hrefstringOptional"#"
actionLabelstringOptional"Learn more"
statusstringOptional""
classstringOptional""

Slots

This component does not declare a slot.

Events

This component does not declare a custom event.

Source contract

Installed source: components/ProductCard.wrn

component ProductCard {
  props {
    eyebrow = ""
    title = ""
    description = ""
    href = ""
    actionLabel = "Learn more"
    status = ""
    class = ""
  }

  view {
        <article class="group flex h-full min-h-72 flex-col rounded-2xl border border-[var(--wire-color-border,#e2e8f0)] bg-[var(--wire-color-surface,#ffffff)] p-6 shadow-[var(--wire-shadow-1,0_1px_2px_rgb(0_0_0/0.05))] transition duration-200 hover:-translate-y-1 hover:border-[var(--wire-color-primary,#059669)] hover:shadow-[var(--wire-shadow-1,0_12px_30px_rgb(0_0_0/0.10))] {class}">
        <div class="flex min-h-7 items-start justify-between gap-4">
        {#if eyebrow}<span class="text-xs font-bold uppercase tracking-[0.14em] text-[var(--wire-color-primary,#059669)]">{eyebrow}</span>{/if}
        {#if status}<span class="shrink-0 rounded-full bg-[var(--wire-color-surface-2,#f8fafc)] px-2.5 py-1 text-[0.7rem] font-bold text-[var(--wire-color-muted,#64748b)]">{status}</span>{/if}
      </div>
      {#if title}<h3 class="mt-5 text-xl font-semibold tracking-[-0.02em] text-[var(--wire-color-text,#0f172a)]">{title}</h3>{/if}
      {#if description}<p class="mt-3 flex-1 leading-7 text-[var(--wire-color-muted,#64748b)]">{description}</p>{/if}
      {#if href}
        <a href="{href}" class="mt-6 inline-flex items-center gap-2 border-t border-[var(--wire-color-border,#e2e8f0)] pt-5 font-semibold text-[var(--wire-color-primary,#059669)] no-underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--wire-color-primary,#059669)]">
        <span>{actionLabel}</span>
        <span class="transition-transform group-hover:translate-x-0.5" aria-hidden="true">→</span>
        </a>
      {/if}
    </article>
    }
}
} }