Skip to contentGet startedTokensComponents@hackclub/theme@hackclub/tokens@hackclub/css-base@hackclub/components@hackclub/meta GitHub

Surface

The everyday card, on the surface color.

Raised

Bordered, with a soft warm shadow.

Image

Text over a photo. This one is a link.

With media

Media slot, lifts on hover.

Open
<div class="grid">
  <hc-card>
    <h3 class="card-title">Surface</h3>
    <p class="card-text">The everyday card, on the surface color.</p>
  </hc-card>
  <hc-card variant="raised">
    <h3 class="card-title">Raised</h3>
    <p class="card-text">Bordered, with a soft warm shadow.</p>
  </hc-card>
  <hc-card variant="image" image="https://hackclub.com/assets/hero_photo2.webp" href="https://game.hackclub.com">
    <h3 class="card-title">Image</h3>
    <p>Text over a photo. This one is a link.</p>
  </hc-card>
  <hc-card variant="outline" interactive>
    <img slot="media" src="https://hackclub.com/assets/hero_photo3.webp" alt="" height="160" />
    <h3 class="card-title">With media</h3>
    <p class="card-text">Media slot, lifts on hover.</p>
    <hc-button slot="footer" size="sm" variant="secondary">Open</hc-button>
  </hc-card>
</div>

API

Attributes

NameTypeDefaultDescription
variant"surface" | "raised" | "outline" | "image" | "ink""surface"Visual style
href, targetstringMake the whole card a link
imagestringBackground image for the image variant
interactivebooleanfalseLift on hover (automatic with href)

Slots

NameDescription
(default)Body
mediaFull-bleed content above the body
footerPinned to the bottom

CSS parts

NameDescription
cardThe card
bodyPadded body
footerFooter wrapper

CSS custom properties

NameDescription
--hc-card-paddingBody padding
Next: Badge

The design system behind hackclub.com.
Made with <3 by Lamparter.

Get startedTokensComponents@hackclub/theme@hackclub/tokens@hackclub/css-base@hackclub/components@hackclub/metaWebsiteBrand guideIconshackclub/site