Card
Display content in a card with a header, body and footer.
Usage
Use the header, default and footer slots to add content to the Card.
<template>
<PCard>
<template #header>
<CorePlaceholder class="h-8" />
</template>
<CorePlaceholder class="h-32" />
<template #footer>
<CorePlaceholder class="h-8" />
</template>
</PCard>
</template>
Variant
Use the variant prop to change the variant of the Card.
<template>
<PCard variant="subtle">
<template #header>
<CorePlaceholder class="h-8" />
</template>
<CorePlaceholder class="h-32" />
<template #footer>
<CorePlaceholder class="h-8" />
</template>
</PCard>
</template>
API
Props
| Prop | Default | Type |
|---|---|---|
as | 'div' | anyThe element or component this component should render as. |
variant | 'outline' | "solid" | "outline" | "soft" | "subtle" |
pohon | { root?: ClassValue; header?: ClassValue; body?: ClassValue; footer?: ClassValue; } |
Slots
| Slot | Type |
|---|---|
header | object |
default | object |
footer | object |
Theme
We use unocss-variants to customize the theme. Read more about it in the theming guide.
Below is the theme configuration skeleton for the PCard. Since the component is provided unstyled by default, you will need to fill in these values to apply your own custom look and feel. If you prefer to use our pre-built, opinionated styling, you can instead use our UnoCSS preset, this docs is using it as well.
app.config.ts
export default defineAppConfig({
pohon: {
card: {
slots: {
root: '',
header: '',
body: '',
footer: ''
},
variants: {
variant: {
solid: {
root: ''
},
outline: {
root: ''
},
soft: {
root: ''
},
subtle: {
root: ''
}
}
},
defaultVariants: {
variant: 'outline'
}
}
}
};
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'
export default defineAppConfig({
pohon: {
card: {
slots: {
root: '',
header: '',
body: '',
footer: ''
},
variants: {
variant: {
solid: {
root: ''
},
outline: {
root: ''
},
soft: {
root: ''
},
subtle: {
root: ''
}
}
},
defaultVariants: {
variant: 'outline'
}
}
}
};
Changelog
No recent changes