Svelte Card - Bitblue

Use the card component as a flexible content container with optional image, link, horizontal layout, and shadow variants

Cards group related content in a bordered, shadowed surface.

Setup

<script lang="ts">
	import { Card, Button } from '.';
</script>

Default card

Noteworthy technology acquisitions

Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.

<script lang="ts">
	import { Card, Button } from '.';
</script>

<Card>
	<div class="p-5">
		<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
			Noteworthy technology acquisitions
		</h5>
		<p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
			Here are the biggest enterprise technology acquisitions of 2021 so far.
		</p>
		<Button>Read more</Button>
	</div>
</Card>

Card with image

Office
Office content

Get started with a large variety of cards for your project.

<script lang="ts">
	import { Card } from '.';
</script>

<Card img="/image.png" imgAlt="Office">
	<div class="p-5">
		<h5 class="mb-2 text-2xl font-bold">Office content</h5>
		<p>Get started with a large variety of cards for your project.</p>
	</div>
</Card>

Horizontal card

Horizontal layout

Use horizontal for side-by-side image and content.

<script lang="ts">
	import { Card } from '.';
</script>

<Card horizontal img="/image.png" size="md">
	<div class="p-5">
		<h5 class="mb-2 text-2xl font-bold">Horizontal layout</h5>
		<p>Use horizontal for side-by-side image and content.</p>
	</div>
</Card>

Card as link

<script lang="ts">
	import { Card } from '.';
</script>

<Card href="/docs" hoverable>
	<div class="p-5">
		<h5 class="mb-2 text-xl font-bold">Clickable card</h5>
		<p>Pass href to render an anchor.</p>
	</div>
</Card>

Composition notes

  • Without href, the root is a div; with href, an anchor (hover styles apply automatically).
  • img renders above (or beside when horizontal) the children content block.
  • Use reverse to flip image/content order; combine with horizontal for RTL-style media.

Props

CardProps

PropTypeDefaultDescription
childrenSnippet—Card body
imgstring—Image URL
imgAltstring''Image alt text
horizontalbooleanfalseSide-by-side image/content
reversebooleanfalseReverse image/content order
shadowxs | sm | normal | md | lg | xl | 2xl | inner | nonemdShadow size
sizexs | sm | md | lg | xlsmMax width
hoverablebooleanfalseHover background
hrefstring—Render as link
classes{ base?, image? }—Theme slot class overrides
classClassValue—Root classes
…restdiv / anchor attrs—Forwarded to the root

Snippets

SnippetDescription
childrenCard content (typically padded text / actions)

© 2026 Bitblue is a registered trademark. All Rights Reserved.