ReviewOS

stacks/stx

Built-in Card component (<StxCard>)

#1684
Closed glennmichael123 opened this 23 days ago · 1 comment
23 days ago

Summary

Content container with header, body, and footer slots.

Usage

<StxCard>
  <template #header>
    <h3>Card Title</h3>
  </template>
  
  <p>Card body content</p>
  
  <template #footer>
    <button>Action</button>
  </template>
</StxCard>

<StxCard variant="outline" hoverable>
  <StxImage src="/photo.jpg" slot="cover" />
  <h3>Photo Card</h3>
  <p>With cover image</p>
</StxCard>

Props

  • variant: elevated | outline | filled | ghost (default: elevated)
  • hoverable — hover shadow/border effect
  • padding — none | sm | md | lg (default: md)
  • radius — none | sm | md | lg (default: md)

Slots

  • default — body content
  • #header — card header with bottom border
  • #footer — card footer with top border
  • #cover — full-width image above header
23 days ago

Delivered via @stacksjs/components, which ships with every stx app and is auto-registered (no import needed in .stx files). See CLAUDE.md § "Reach for stx primitives before vanilla JS" for the full inventory; the relevant components for this request are documented there.

Closing as effectively delivered. If a specific behavior or API affordance from the original request is missing from the shipped components, please open a focused ticket against @stacksjs/components describing the exact gap — that's easier to track than a broad "make it a builtin" ask.

Sign in to comment on this issue.