Packages
react
components
CartCost

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

NameTypeDefaultDescription
amountType`'total''subtotal''tax'
childrenReactNodeAny 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.