Docs
Card

Card

Displays a card with header, content, and footer.

Loading...

Installation

	npx shadcn-svelte add card

Usage

	<script lang="ts">
  import * as Card from "$components/ui/card";
</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>

Modify the heading level

By default, the <CardTitle> component renders an <h3> element. You can change this by passing a tag prop to the component.

For example:

	<CardTitle tag="h2">This will render an H2</CardTitle>
	<CardTitle tag="h5">This will render an H5</CardTitle>
	<CardTitle tag="p">This will render a P tag</CardTitle>

Examples

Loading...