-
-
Notifications
You must be signed in to change notification settings - Fork 625
Expand file tree
/
Copy pathCard.vue
More file actions
27 lines (24 loc) · 789 Bytes
/
Card.vue
File metadata and controls
27 lines (24 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<script setup>
import { cva } from 'cva';
const props = defineProps({
/** When `true`, the internal padding of the card is removed. */
inset: { type: Boolean, default: false },
/** Controls the appearance of the card. <br><br> Options: `default`, `flat` */
variant: { type: String, default: 'default' },
});
const classes = cva({
base: 'bg-white dark:bg-gray-850 rounded-xl ring ring-gray-200 dark:ring-x-0 dark:ring-b-0 dark:ring-gray-700/80',
variants: {
variant: {
default: 'shadow-ui-md',
flat: 'shadow-none',
},
inset: { false: 'px-4 sm:px-4.5 py-5 space-y-2' },
},
})({ ...props });
</script>
<template>
<div :class="classes" data-ui-card :data-inset="inset">
<slot />
</div>
</template>