The Discount Coupon Library is a package that provides a reusable component to display discount coupons in React applications.
To install the Discount Coupon Library, use your preferred package manager:
npm install discountcoupon-library
yarn add discountcoupon-library
Import the DiscountCoupon component into your React application as shown below: import { DiscountCoupon } from 'discountcoupon-library';
The DiscountCoupon component takes the following props:
couponData: An object containing the coupon information with the following properties:
code: The coupon code (string) discount: The discount amount (string) description: Description of the coupon (string) image: Path to the coupon image (string) onShare: Function to handle the share button click event.
onLearnMore: Function to handle the 'Know More' link click event.
The library includes predefined CSS classes to style the coupon component. You can also customize these styles according to your preferences.