reusable-cart-component
v1.0.42
Published
This is a reusable cart component you can install to you react application to display cart items. it includes all functionalities of a cart component: adding or reducing the quantity of an item, removing items from the cart as well as clearing the cart.
Downloads
65
Maintainers
Readme
Reusable-Cart-Component
This is a reusable cart component you can install to an e-commerce react application to display cart items. it includes all functionalities of a cart component:
- Viewing items added to cart
- Adding or reducing the quantity of an item
- Removing an item from the cart
- Clearing the cart.
- Displaying the total amount of all items in Ksh
- Displaying the amount per item based on the quantity
How to Install
npm install --save reusable-cart-component
Usage
- In the jsx component you want to display the cart items you need to:
- Install the components in your main folder
- Ensure the component is visible in your
package.json file
- Import the component as shown below
- Instantiate the component
- Provide the cart items (the items selected by a user from the main products page)
- The component will do the rest 🎊
import MyComponent from 'reusable-cart-component'
import 'reusable-cart-component/dist/index.css'
const Cart = () => {
return (
<div>
<ReusableCartComponent items={items} cartId={cartId} />
</div>
)
}
export default Cart
Requirements
Node version >=10
License
MIT ©
Github
Reach out
- For any queries,suggestions reach out to: [email protected] [email protected] [email protected]