#NuxtUI Card
4 messages · Page 1 of 1 (latest)
Hi @azure rivet. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
The NuxtUI Card component provides slot-based structure for header, body, and footer, and you can customize its layout using the ui prop or by overriding its theme in your configuration. However, the official documentation does not explicitly describe a built-in prop or method to force the footer to always align at the same height across multiple cards with varying content lengths.
That said, the default theme for the Card component uses a flex column layout for the card body, which you can leverage. To ensure the footer is always at the bottom, you can apply a utility class like flex flex-col h-full to the card root and mt-auto to the footer slot, so the footer pushes to the bottom regardless of the body content height. You can do this by customizing the ui prop or the theme:
<template>
<UCard :ui="{ root: 'flex flex-col h-full', footer: 'mt-auto' }">
<template #header>
<Placeholder class="h-8" />
</template>
<Placeholder class="h-32" />
<template #footer>
<Placeholder class="h-8" />
</template>
</UCard>
</template>
Or, to apply this globally, update your app.config.ts:
export default defineAppConfig({
ui: {
card: {
slots: {
root: 'flex flex-col h-full',
footer: 'mt-auto'
}
}
}
})