Card

A simple island card for product previews with image, content, price and action.

Installation

npx alixan-ui-nuxt add card

Usage

MacBook Pro 14-inch

Powerful laptop with Apple Silicon performance, a stunning Liquid Retina display, and all-day battery life.

$640


<script setup lang="ts">
const toast = useToast();

const onTap = () => {
  toast.open('card.addedToCard', 'success');
};
</script>

<template>
	<Card
		image="/mac.webp"
		title="card.demoTitle"
		description="card.demoDescription"
		price="$640"
		button="card.addToCart"
		@on-tap="onTap"
	/>
</template>

API Reference

PropTypeDefaultDescription
imagestring-Image URL rendered at the top of the card.
imageAltstring''Accessible alt text for the image.
titlestring-Main card title.
descriptionstring-Optional supporting text.
pricestring-Price text shown next to the action button.
buttonstring-Optional action button label.
@on-tap() => void-Emitted when the button is clicked.