CartCost
The CartCost component is a part of the shopping cart feature and is responsible for rendering the cost associated with a specific type. It relies on data provided by the CartProvider and renders a Money component accordingly.
Usage
import React from "react";
import { CartCost } from "@airsoko/react";
const MyComponent = () => {
return <CartCost amountType="subtotal" />;
};
export default MyComponent;Props
| Name | Type | Default | Description |
|---|---|---|---|
amountType | `'total' | 'subtotal' | 'tax' |
children | ReactNode | Any additional React elements to be rendered within the CartCost component. |
Other Props
The CartCost component accepts all other props that are accepted by the Money component, as it internally renders the Money component to display the cost.