0.1.2 • Published 3 years ago
@narsodev/product-card v0.1.2
product-card
Product card component for React.
Learning purposes.
Example
import { ProductCard, ProductImage, ProductTitle, ProductButtons } from 'product-card'
const product = {
id: '1',
title: 'Coffee Mug - Card',
img: './coffee-mug.jpg'
}
<ProductCard
product={product}
initialValues={{ count: 1, maxCount: 10 }}
>
{
({ count, isMaxCountReached, maxCount, increaseBy, reset }) => (
<>
<ProductImage />
<ProductTitle />
<ProductButtons />
</>
)
}
</ProductCard>