Skip to content
← UI Library

Stacked display cards

Three skewed cards stacked in depth. Back cards stay muted until you hover, then lift into colour.

Svelte 5 · Version 1.0.0 · Zero extra packages

Connect MCP

Live preview

  • Deploy

    Production is live on v2.4

    Just now
  • Review

    3 comments on onboarding flow

    2 hours ago
  • Launch

    Release notes are ready to send

    Today

Design decision

Depth suggests a stream of activity in a small space, which suits hero visuals and feature callouts. Original Svelte 5 implementation. No code was copied from the inspiring component.

Inspired by Display Cards by @Codehagen on 21st.dev ↗

Source and integration

Pass two to four cards with title, description and date. Set --ui-page-bg to the colour behind the cards so the edge fade blends.

You may copy and adapt this original SaaSCrisp implementation in personal and commercial websites.

DisplayCards.svelte
<script lang="ts">
	type Card = { title: string; description: string; date: string };
	let { cards }: { cards: Card[] } = $props();
</script>

<ul class="dc">
	{#each cards as card, index (card.title)}
		<li class="dc-card" style:--i={index} style:--n={cards.length}>
			<div class="dc-head">
				<span class="dc-icon" aria-hidden="true">
					<svg viewBox="0 0 24 24"><path d="M12 3l2.6 5.6L20 9.4l-4 4 1 5.6-5-2.8-5 2.8 1-5.6-4-4 5.4-.8z" /></svg>
				</span>
				<h3>{card.title}</h3>
			</div>
			<p>{card.description}</p>
			<span class="dc-date">{card.date}</span>
		</li>
	{/each}
</ul>

<style>
	.dc {
		--_border: var(--ui-border, rgb(255 255 255 / 0.1));
		--_text: var(--ui-text, #ededf0);
		--_muted: var(--ui-muted, #8b8b94);
		--_accent: var(--ui-accent, #c8ff3c);
		--_step-x: 44px;
		--_step-y: 38px;
		display: grid;
		place-items: center;
		margin: 0;
		padding: 0 0 calc(var(--_step-y) * 2) 0;
		list-style: none;
		font-family: var(--ui-font, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif);
	}
	.dc-card {
		grid-area: 1 / 1;
		position: relative;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		width: min(22rem, 78vw);
		height: 9rem;
		padding: 14px 16px;
		border: 1px solid var(--_border);
		border-radius: 14px;
		background: rgb(20 20 23 / 0.75);
		backdrop-filter: blur(10px);
		box-shadow: 0 20px 40px -20px rgb(0 0 0 / 0.8);
		translate: calc((var(--i) - (var(--n) - 1) / 2) * var(--_step-x)) calc(var(--i) * var(--_step-y));
		transform: skewY(-8deg);
		transition:
			translate 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
			filter 0.5s,
			border-color 0.3s;
		filter: grayscale(1) brightness(0.65);
	}
	.dc-card:last-child,
	.dc-card:hover {
		filter: none;
	}
	.dc-card:hover {
		translate: calc((var(--i) - (var(--n) - 1) / 2) * var(--_step-x)) calc(var(--i) * var(--_step-y) - 36px);
		border-color: rgb(255 255 255 / 0.2);
	}
	.dc-card::after {
		content: '';
		position: absolute;
		inset: -1px -1px -1px 55%;
		border-radius: 0 14px 14px 0;
		background: linear-gradient(90deg, transparent, var(--ui-page-bg, #09090b));
		pointer-events: none;
	}
	.dc-head {
		display: flex;
		align-items: center;
		gap: 10px;
	}
	.dc-icon {
		display: grid;
		place-items: center;
		width: 26px;
		height: 26px;
		border-radius: 999px;
		background: color-mix(in srgb, var(--_accent) 18%, transparent);
		color: var(--_accent);
	}
	.dc-icon svg {
		width: 13px;
		height: 13px;
		fill: currentColor;
	}
	h3 {
		margin: 0;
		color: var(--_accent);
		font-size: 17px;
		font-weight: 600;
		letter-spacing: -0.01em;
	}
	p {
		margin: 0;
		color: var(--_text);
		font-size: 16px;
		white-space: nowrap;
	}
	.dc-date {
		color: var(--_muted);
		font-size: 13px;
	}
	@media (max-width: 520px) {
		.dc {
			--_step-x: 20px;
			--_step-y: 30px;
		}
	}
	@media (prefers-reduced-motion: reduce) {
		.dc-card {
			transition: none;
		}
	}
</style>
Agent prompt

Use the SaaSCrisp UI Library MCP at https://www.saascrisp.com/api/library/mcp. Retrieve display-cards version 1.0.0 for svelte with get_ui_asset. Preview: https://www.saascrisp.com/library/display-cards. Confirm the project's stack, reuse local primitives and map CSS variables to existing design tokens. Integrate the files and run the project's checks. Report changed files and additional dependencies.