Badge
Card 6.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 { ItemGrid0, Card6 } from '@yatoday/astro-ui/astro';
---
<ItemGrid0 columns={3} class="bg-stripe ">
<div className="text-white">
<Card6
title="Card 6.1"
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit."
image={{ src: '~/assets/images/800x800.svg', alt: 'Card 6.1' }}
callToAction={{ href: '/' }}
badge="Badge"
>
<!-- or -->
<Fragment slot="badge">
<Badge>Badge</Badge>
</Fragment>
</Card6>
</div>
<div className="text-white">
<Card6
title="Card 6.2"
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit."
image={{ src: '~/assets/images/800x800.svg', alt: 'Card 6.2' }}
/>
</div>
<Card6
title="Card 6.3"
description="Lorem ipsum dolor sit amet, consectetur adipisicing elit."
callToAction={{ href: '/' }}
classes={{container: 'dark:text-white text-slate-800'}}
/>
</ItemGrid0>
Prop | Type | Default | Description |
---|---|---|---|
title | string | - | Title text for the card |
description | string | - | Content for the card |
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.content | string | bg-gradient-to-b from-transparent to-black/80 | Additional CSS classes to apply to the content wrapper |
classes.title | string | - | Additional CSS classes to apply to the title |
classes.description | string | text-muted-foreground | Additional CSS classes to apply to the description |
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 |
classes.aspect | string | pb-[100%] | Additional CSS classes to customize aspect ratio behavior. Examples: - 16/9: pb-[56%], 4/3: pb-[75%], 1/1: pb-[100%] - default, 6/7: pb-[116%], 4/5: pb-[125%], 3/4: pb-[133%], 9/16: pb-[177%] |