Badge
Card 2.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 { Card2, ItemGrid0 } from '@yatoday/astro-ui/astro';
---
<ItemGrid0 columns={3}>
<Card2
title="Card 2.1"
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit."
image={{src: '~/assets/images/800x800.svg', alt: ''}}
url="/"
>
<Fragment slot="badge">
<div className="text-green-700 font-semibold animate-pulse">Badge</div>
</Fragment>
</Card2>
<Card2
title="Card 2.2"
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit."
icon="tabler:home"
url="/"
/>
<Card2 title="Card 2.3" description="Lorem ipsum dolor sit amet, consectetur adipisicing elit." />
</ItemGrid0>
Both callToAction
and URL
are supported. The button will not be displayed.
Prop | Type | Default | Description |
---|---|---|---|
title | string | - | Title text for the card |
image | string | Image | - | Path to the card’s image |
icon | string | - | Name icon from set |
badge | string | - | badge slot contents |
as | string | article | HTML tag name for the wrapper |
asHeader | string | h3 | HTML tag name for the title |
url | string | - | URL for the card’s link wrapper |
callToAction | ToAction | - | Action button or link. See the ToAction for details. |
classes.container | string | - | 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.icon | string | - | Additional CSS classes to apply to the icon |
classes.badge | string | top-2 left-2 | Additional CSS classes to apply to the badge |