NEW
Card 3.1
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Getting started
UI
W.Feature
Widget
The Card component provides a versatile container for displaying related content. It uses semantic HTML and ensures proper heading structure and content organization.
---
import { Card3, ItemGrid0 } from '@yatoday/astro-ui/astro';
---
<ItemGrid0 columns={3} class="bg-stripe">
<Card3
title="Card 3.1"
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit."
image={{ src: '~/assets/images/800x800.svg', alt: 'Card 3.1' }}
callToAction={{ href: '/', text: 'Read more', size: 'sm', variant: 'primary' }}
badge="QWERT"
>
<Fragment slot="badge">
<div className="text-green-700 font-semibold">NEW</div>
</Fragment>
</Card3>
<Card3
title="Card 3.2"
image={{ src: '~/assets/images/800x800.svg', alt: 'Card 3.2' }}
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit."
icon="tabler:home"
callToAction={{ href: '/', text: 'Read more', size: 'sm', variant: 'outline' }}
/>
<Card3
title="Card 3.3"
image={{ src: '~/assets/images/800x800.svg', alt: 'Card 3.3' }}
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit."
callToAction={{ href: '/', text: 'Read more', size: 'sm', variant: 'outline' }}
/>
</ItemGrid0>
Prop | Type | Default | Description |
---|---|---|---|
title | string | - | Title text for the card |
image | string | Image | - | Image for the card |
badge | string | - | badge slot contents |
callToAction | ToAction | string | ToAction[] | string[] | - | Action button or link. See the ToAction for details. |
as | string | article | HTML tag name for the wrapper |
asHeader | string | h3 | HTML tag name for the title |
classes.container | string | bg-transparent border-transparent | Additional CSS classes to apply to the card wrapper |
classes.title | string | - | Additional CSS classes to apply to the title |
classes.content | string | text-muted-foreground | Additional CSS classes to apply to the content container |
classes.image | string | - | Additional CSS classes to apply to the image |
classes.badge | string | top-2 left-2 | Additional CSS classes to apply to the badge |