Responsive image card with square thumbnail, optional subtitle, title, and paragraph. Uses @nuxt/image and design tokens for typography, color, and radius.
Prop | Type | Default / Req. | Description |
---|---|---|---|
image | Object | required | Image object containing `src` and `alt` properties. |
subtitle | String | — | Optional subtitle text displayed above the title. |
title | String | required | Main title displayed under the subtitle. |
description | String | required | Descriptive text displayed below the title. |
You may use these UI components in your own personal or commercial projects. You may not resell, redistribute, sublicense, or package them as standalone assets or template/library packs.
Full terms: End-User License Agreement
Below you can expand the main implementation file and any supporting components. Use the “Copy” button to grab a snippet straight to your clipboard.
These are the raw components that are required to run this example. Copy-paste them into your project. Most likely you will not change anything in these files, but you can if you want to. These are the components that are used in the main implementation file.
<script setup>
const props = defineProps({
image: {
type: Object,
required: true,
validate: (value) => {
return value && typeof value.src === "string" && typeof value.alt === "string";
},
},
subtitle: {
type: String,
required: false,
},
title: {
type: String,
required: true,
},
description: {
type: String,
required: true,
},
});
</script>
<template>
<div
class="font-iq-paragraph leading-iq-paragraph tracking-iq-paragraph text-iq-paragraph-color"
>
<NuxtImg
class="aspect-square rounded-iq-roundness w-full object-cover object-center mb-6"
:src="image.src"
:alt="image.alt"
/>
<h4 v-if="subtitle" class="text-xs">
{{ subtitle }}
</h4>
<h3
class="text-xl mb-2 font-iq-header leading-iq-header tracking-iq-header text-iq-header-color"
>
{{ title }}
</h3>
<p class="text-justify">
{{ description }}
</p>
</div>
</template>
This is the main Vue file that uses the component. Copy-paste this into your project. In this code feel free to change anything you like, such as the component name, props, or class. This is the place where you control the main component.
<script setup>
const card = {
image: {
src: "https://picsum.photos/700",
alt: "Image Alt Text"
},
subtitle: "Subtitle",
title: "Card Title",
description: "This is a description for the third card. It provides additional information about the content of the card. lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
};
</script>
<template>
<div class="iq-card-glass max-w-2xl mx-auto m-8">
<CardsImage class="p-6" :image="card.image" :subtitle="card.subtitle" :title="card.title" :description="card.description"/>
</div>
</template>
Decide whether you want a global design-system or a one-off inline snippet.
Complete @theme
block – import once and share across every component.
Copy the code below into main.css
file. It is most likely in assets/css/main.css
directory.
:style
binding – paste straight onto any of ours components.
Copy the code below and paste it into the :style
binding of the component.
I wish I could automate every little thing—but for now you’ll need to handle these final steps by hand. Apologies for the extra work!
iq-card-*
style Now that you’ve picked a card preset, copy its CSS into your @layer components
block in main.css
. This ensures every `iq-card
` wrapper will look just right.
iq-cta
iq-cta is the main call to action button class. It’s used in many places across the components. But for now it is only a single class that you can customize. You can copy the code below and paste it into your @layer components
block in main.css
. In future you will be able to fully customize it from our UI and choose from many presets.
I didn't have time to figure out consistency. Although there are no actions required, be mindful that the forms might not be entirely consistent with the design system. A quick once-over will keep everything looking sharp.