Premium Product Card
E-commerce card with 'detached' image look, sweep corners, and dark/light themes.
Component Features and Props
How to Use Premium Product Card Component
Installation Guide for Premium Product Card
Component Props
Specifications
| Prop | Type | Default | Description |
|---|---|---|---|
theme | 'light' | 'dark' | light | Color theme |
title | string | - | Product title |
price | string | - | Product price |
description | string | - | Product description |
imageReq | ImageSourcePropType | - | Product image |
Install
TERMINAL
$ npx expo install expo-vector-iconsComponent Code
Component.tsx
1import React from 'react';
2import {
3 StyleSheet,
4 View,
5 Text,
6 Image,
7 TouchableOpacity,
8 Dimensions,
9 ImageSourcePropType,
10} from 'react-native';
11import { Ionicons, Feather } from '@expo/vector-icons';
12
13const { width } = Dimensions.get('window');
14
15interface PremiumCardProps {
16 theme?: 'light' | 'dark';
17 title?: string;
18 price?: string;
19 description?: string;
20 image: ImageSourcePropType;Usage
Usage.tsx
import React from 'react';
import { StyleSheet, View, ScrollView, StatusBar } from 'react-native';
import PremiumCard from './components/ProductCard';
const ICE_CREAM_IMG = "https://images.unsplash.com/photo-1563805042-7684c019e1cb?q=80&w=1000&auto=format&fit=crop";
export default function App() {
return (
<View style={styles.container}>
<StatusBar barStyle="dark-content" />
<ScrollView contentContainerStyle={styles.scroll}>
{/* LIGHT THEME: Image sits inside a white padded frame */}
<PremiumCard
theme="light"
image={{ uri: ICE_CREAM_IMG }}
/>
{/* DARK THEME: Image sits inside a brown padded frame */}
<PremiumCard100%
Interactive Preview running on Expo Web.
Gestures and animations are simulated.
100%
