Product Card Basic
Product tile with sale and stock badges, rating, price, colour swatches that switch the image, and an add-to-cart button that confirms the add.
Parts
| Part | File | Does |
|---|---|---|
| ProductCardBasic | ProductCardBasic.vue | Shows a product with its image, price and rating, with an add-to-cart button. |
Styling
All of Product Card Basic’s styles live in product-card-basic.json. New to styling in Frontic UI? How styling works →
Install
- npm packages
- @lucide/vue
- @vueuse/core
Built from
API reference
Shows a product with its image, price and rating, with an add-to-cart button.
Props 13
| Prop | Type | Default | |
|---|---|---|---|
| product* | Product | — | |
| |||
| eyebrow | string | — | |
| |||
| addToCartLabel | string | 'Add to Cart' | |
| |||
| addedLabel | string | 'Added' | |
| |||
| clearoutLabel | string | 'Clearout' | |
| |||
| inStoreLabel | string | 'In Store' | |
| |||
| colourLabel | string | 'Colour' | |
| |||
| moreColoursLabel | ((count: number) => string) | `+${count}` | |
| |||
| locale | string | — | |
| |||
| ratingLabel | ((score: number, max: number) => string) | — | |
| |||
| ratio | number | 1 | |
| |||
| surface | 'raised' | 'bare' | 'raised' | |
| |||
| class | ClassValue | — | |
| |||
Events 1
| Event | Payload | |
|---|---|---|
| add-to-cart | product: Product | |
| ||
Data attributes 1
| Data attribute | Values | |
|---|---|---|
| data-surface | 'raised' | 'bare' | |
| ||