Card.vue component is a reusable Vue.js container designed for structured content with optional headers, footers, and a main content area. It allows customization through named slots. The CardHuge.vue component extends Card.vue with additional styling or behavior for larger or more prominent use cases.
Features
Customizable Headers and Footers
Includes optional
headerLeft, headerRight, and footer slots for structured content.Dynamic Content
Allows flexible content placement in the main body and slots.
Reusable Design
Use
Card.vue for standard containers and CardHuge.vue for larger displays.Usage
Basic Example with Header and Footer
Large Card Example
Props
This component does not accept any props. Customization is achieved using named slots.Slots
Defines content for the left side of the header.
<template #headerLeft></template>Defines content for the right side of the header.
<template #headerRight></template>Defines the main content of the container.
Defines content for the footer area (optional).
<template #footer></template>Example Use Cases
Content Container with Headers and Footer
Use theCard component to structure a content box with a header, main body, and footer:
Large Content Container
UseCardHuge for larger or more prominent content:
Notes
- Slot Customization: The
CardandCardHugecomponents rely entirely on named slots for customization, making them highly flexible for different use cases. - Reusability: Use
Card.vuefor standard containers andCardHuge.vuefor larger layouts. - Styling: The appearance of these components is controlled by CSS classes applied in the template.