# Reveal card

Layered artwork opens on hover to reveal a project’s next step.

## Usage

Use a reveal card for a project or resource preview. Keep the action and title readable at rest so touch users do not need to discover a hover state.

Save the JSX and CSS Module in the same folder in a React project with CSS Modules support. Controlled components need parent state and change handlers.

## JSX

```jsx
"use client";
import styles from "./RevealCard.module.css";
export default function RevealCard({
  title = "From idea to interface",
  label = "Product design",
  href = "/resources/guides/design-to-code-workflow/",
}) {
  return (
    <a href={href} className={styles.root}>
      <div className={styles.art} aria-hidden="true">
        <div className={styles.sheet}>
          <i />
          <i />
          <div>
            <b />
            <b />
            <b />
          </div>
        </div>
        <div className={styles.chip}>Aa</div>
        <div className={styles.swatch} />
      </div>
      <div className={styles.footer}>
        <span>{label}</span>
        <h3>{title}</h3>
        <div className={styles.reveal}>
          Explore the workflow <span aria-hidden="true">↗</span>
        </div>
      </div>
    </a>
  );
}

```

## CSS

```css
.root {
  display: block;
  width: 310px;
  overflow: hidden;
  border: 1px solid #d6cdc1;
  border-radius: var(--tdp-radius, 12px);
  background: #f8f5ee;
  text-decoration: none;
}
.art {
  height: 185px;
  position: relative;
  background: #e1e7d8;
  overflow: hidden;
}
.sheet {
  position: absolute;
  width: 150px;
  height: 130px;
  left: 50%;
  top: 39px;
  margin-left: -75px;
  background: #fffdf9;
  border: 1px solid #b7bfad;
  border-radius: 8px;
  padding: 20px;
  rotate: -8deg;
  transition:
    transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    rotate 0.6s;
}
.sheet > i {
  display: block;
  height: 5px;
  width: 70px;
  background: #c0c9b5;
  margin-bottom: 9px;
}
.sheet > i + i {
  width: 45px;
}
.sheet > div {
  display: flex;
  gap: 6px;
  margin-top: 17px;
}
.sheet b {
  width: 30px;
  height: 40px;
  border-radius: 4px;
  background: #ddd1e8;
}
.sheet b + b {
  background: #ead2bf;
}
.sheet b + b + b {
  background: #ccd9c0;
}
.chip {
  position: absolute;
  left: 25px;
  top: 85px;
  width: 64px;
  height: 68px;
  border: 1px solid #baa6c9;
  border-radius: 6px;
  background: #dacee5;
  display: grid;
  place-items: center;
  font: 32px Georgia;
  rotate: -14deg;
  transition: transform 0.6s;
}
.swatch {
  position: absolute;
  right: 27px;
  top: 30px;
  width: 55px;
  height: 65px;
  background: #e9c6af;
  border: 6px solid #fffdf9;
  border-radius: 4px;
  rotate: 13deg;
  transition: transform 0.6s;
}
.root:is(:hover, :focus-visible) .sheet {
  transform: translateY(-12px);
  rotate: 0deg;
}
.root:is(:hover, :focus-visible) .chip {
  transform: translate(-8px, 8px) rotate(-8deg);
}
.root:is(:hover, :focus-visible) .swatch {
  transform: translate(9px, -8px) rotate(8deg);
}
.footer {
  padding: 20px;
}
.footer > span {
  font-size: 11px;
  color: #7a6b5e;
}
.footer h3 {
  font-size: 20px;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 7px 0 14px;
}
.reveal {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  transition: padding 0.3s;
}
.root:is(:hover, :focus-visible) .reveal {
  padding-left: 6px;
}
.root {
  font-family: var(--tdp-font, "DM Sans", system-ui, sans-serif);
  color: var(--tdp-text, #302e2b);
  max-width: 100%;
  box-sizing: border-box;
}
.root * {
  box-sizing: border-box;
}
.root :is(button, input, a):focus-visible,
.root:focus-visible {
  outline: 3px solid var(--tdp-focus, #7851a9);
  outline-offset: 4px;
}
.root button {
  font: inherit;
  cursor: pointer;
}
.root button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.root button,
.root a {
  touch-action: manipulation;
}
@media (prefers-reduced-motion: reduce) {
  .root,
  .root *,
  .root::before,
  .root::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    translate: none !important;
    rotate: none !important;
    scale: none !important;
    scroll-behavior: auto !important;
  }
}

```

## Props

- title (string): Project or resource title.
- label (string): Category label.
- href (string): Destination for the card.

## Accessibility

The artwork is hidden from assistive technology. The native link has a visible focus ring. Hover and keyboard focus produce equivalent movement.

Check accessibility again after customizing the component.

[Browse all components](/resources/components/)

Canonical: https://designproject.io/resources/components/reveal-card/

## Keep learning

- [How to create a UI color palette, step by step](https://designproject.io/resources/guides/create-ui-color-palette/)
- [Product design glossary: 44 terms explained](https://designproject.io/resources/glossary/)
- [How to choose font pairings for a product interface](https://designproject.io/resources/guides/choose-font-pairings/)
