8.0k New

Card

Displays a card with header, content, and footer.

Epicenter

Local-first, open source apps

Special Sponsor
Login to your account

Enter your email below to login to your account

Installation

pnpm dlx shadcn-svelte@latest add card

Usage

<script lang="ts">
  import * as Card from "$lib/components/ui/card/index.js";
</script>
<Card.Root>
  <Card.Header>
    <Card.Title>Card Title</Card.Title>
    <Card.Description>Card Description</Card.Description>
  </Card.Header>
  <Card.Content>
    <p>Card Content</p>
  </Card.Content>
  <Card.Footer>
    <p>Card Footer</p>
  </Card.Footer>
</Card.Root>

Examples

Login to your account

Enter your email below to login to your account

Spacing

In addition to the size prop, you can use the --card-spacing CSS variable to control the spacing between sections and the inset of card parts.

Login to your account

Enter your email below to login to your account

Use negative margins with -mx-(--card-spacing) to make content go edge to edge while keeping it aligned with the card inset. When the edge-to-edge content sits above a footer, use -mb-(--card-spacing) on CardContent to remove the section gap.

Terms of Service

Review the terms before accepting the agreement.

These terms govern your use of the workspace, including access to shared documents, project files, and collaboration tools.

You are responsible for the content you upload and for ensuring that your team has the appropriate permissions to view or edit it.

We may update features or limits as the service evolves. When those changes materially affect your workflow, we will notify your workspace administrators.

By continuing, you agree to keep your account credentials secure and to follow your organization's acceptable use policies.

Image

Add an image before the card header to create a card with an image.

Event cover
Featured
Design systems meetup

A practical talk on component APIs, accessibility, and shipping faster.