Badge
Card 1.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 { Card1, ItemGrid0 } from '@yatoday/astro-ui/astro';
---
<ItemGrid0 columns={4} class="bg-stripe">
<Card1
title="Card 1.1"
description='Lorem ipsum dolor sit amet, consectetur adipisicing elit.'
image={{ src: '~/assets/images/800x800.svg', alt: 'Lorem Test' }}
callToAction={{ href: '/', text: 'Read more' }}
links={[
{ href: '/', text: 'Additional link 1' },
{ href: '/', text: 'Additional link 2' },
{ href: '/', text: 'Additional link 3' },
]}
>
<Fragment slot="badge">
<div className="text-green-700 font-semibold text-sm border p-1 rounded">Badge</div>
</Fragment>
</Card1>
<Card1
title="Card 1.2"
description='Lorem ipsum dolor sit amet, consectetur adipisicing elit.'
image={{ src: '~/assets/images/800x800.svg', alt: 'Lorem Ipsum' }}
callToAction={{ href: '/', text: 'Read more' }}
data={[
{name: 'Param name', value: 'Param value'},
{name: 'Param name', value: 'Param value'},
{name: 'Param name', value: 'Param value'},
]}
/>
<Card1
title="Card 1.3"
description='Lorem ipsum dolor sit amet, consectetur adipisicing elit.'
icon="tabler:home"
callToAction={{ href: '/', text: 'Read more' }}
data={[
{name: 'Param name', value: 'Param value'},
{name: 'Param name', value: 'Param value'},
{name: 'Param name', value: 'Param value'},
{name: 'Param name', value: 'Param value'},
{name: 'Param name', value: 'Param value'},
]}
/>
<Card1
title="Card 1.4"
description='Lorem ipsum dolor sit amet, consectetur adipisicing elit.'
image={{ src: '~/assets/images/800x800.svg', alt: 'Lorem Ipsum' }}
callToAction={{ href: '/', text: 'Read more' }}
classes={{image: 'h-40'}}
/>
<Card1
title="Card 1.5"
description='Lorem ipsum dolor sit amet, consectetur adipisicing elit.'
image={{ src: '~/assets/images/800x800.svg', alt: 'Lorem Ipsum' }}
icon="tabler:home"
classes={{image: 'h-40'}}
/>
<Card1
title="Card 1.6"
description='Lorem ipsum dolor sit amet, consectetur adipisicing elit.'
icon="tabler:home"
/>
</ItemGrid0>
Prop | Type | Default | Description |
---|---|---|---|
title | string | - | Title text for the card |
description | string | - | Content 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. |
icon | string | - | Name icon from set |
as | string | article | HTML tag name for the wrapper |
asHeader | string | h3 | HTML tag name for the title |
data | NameValue [] | - | Array of data strings |
links | Array | [] | Array of Link items |
classes.title | string | - | Additional CSS classes to apply to the title |
classes.description | string | - | Additional CSS classes to apply to the description |
classes.image | string | - | Additional CSS classes to apply to the image |
classes.icon | string | - | Additional CSS classes to apply to the icon |
classes.quickLink | string | - | Additional CSS classes to apply to each quickLink |
classes.action | string | - | Additional CSS classes to apply to the action |