Card
A beautiful card to use on your application to display resource, forms or anything on your imagination 😄
Preview & Playground 🖼️
Here you may find a preview of the component, with error & possible variants.
🏄 Click to expand the code
vue
<script setup lang="ts">
import { Button, Card, DropdownMenu, DropdownOption } from '@flavorly/vanilla-components'
</script>
<template>
<PreviewWrapper>
<!-- Regular -->
<div class="h-[220px]">
<Card
title="Payment Methods"
subtitle="Here you can have your favorite payments methods"
>
<template #actions>
<DropdownMenu text="Options">
<DropdownOption>
<span>Copy Stuff</span>
</DropdownOption>
<DropdownOption>
<span>Mark as Done</span>
</DropdownOption>
</DropdownMenu>
</template>
<div class="p-5 text-sm">
<span>Some content on the card</span>
</div>
<template #footerActions>
<Button label="Resets" />
<Button
label="Submit"
variant="primary"
/>
</template>
</Card>
</div>
</PreviewWrapper>
</template>
Props 📥
Props available for this component extending the default variant & global props.
Prop | Description | Accepted Values | Default |
---|---|---|---|
as | Tag to render the button | String | 'button' |
title | Title for the card | [String, undefined] | undefined |
subtitle | Subtitle for the card | [String, undefined] | undefined |
bodyDivided | Divide the items insides card body | Boolean | false |
Slots 🧬
Current slots available for this component are the following:
Slot title
Slot for the title of the card
Slot subtitle
Slot for the subtitle of the card
Slot actions
Slot for the action's panel on the top-right side of the card
Slot default
Default slot for the card body
Slot footer
Slot for the footer of the card
Slot footerActions
Alternative Slot for the footer of the card, supporting buttons styled grid by default aligned to right