Card
Displays a card with header, content, and footer.
Loading preview…
1<script lang="ts">
2 import * as Card from './index.js';
3</script>
4
5<Card.Root class="w-full max-w-sm">
6 <Card.Header>
7 <Card.Title>Card Title</Card.Title>
8 <Card.Description>Card Description</Card.Description>
9 </Card.Header>
10 <Card.Content>
11 <p>Card Content</p>
12 </Card.Content>
13 <Card.Footer>
14 <p>Card Footer</p>
15 </Card.Footer>
16</Card.Root>
17Installation
1. Copy these files into your project
- ~/components/card/index.ts
- ~/components/card/card.svelte
- ~/components/card/card-header.svelte
- ~/components/card/card-title.svelte
- ~/components/card/card-description.svelte
- ~/components/card/card-action.svelte
- ~/components/card/card-content.svelte
- ~/components/card/card-footer.svelte
Usage
Use card to group related content. Compose with Card.Header, Card.Content, and Card.Footer.
Set size to default or sm. Place header actions in Card.Action.
1<script lang="ts">
2 import * as Card from '~/components/card';
3</script>
4
5<Card.Root class="w-full max-w-sm">
6 <Card.Header>
7 <Card.Title>Card Title</Card.Title>
8 <Card.Description>Card Description</Card.Description>
9 </Card.Header>
10 <Card.Content>
11 <p>Card Content</p>
12 </Card.Content>
13 <Card.Footer>
14 <p>Card Footer</p>
15 </Card.Footer>
16</Card.Root>