Packages
react
components
CartLineQuantityAdjustButton

CartLineQuantityAdjustButton Component

The CartLineQuantityAdjustButton component renders a button that adjusts the quantity of a cart line when pressed. It must be a descendant of both the CartLineProvider and CartProvider components.

Usage

import React from "react";
import { CartLineQuantityAdjustButton } from "@airsoko/react";
 
const MyComponent = () => {
  return <CartLineQuantityAdjustButton adjust="increase">Increase Quantity</CartLineQuantityAdjustButton>;
};
 
export default MyComponent;

Props

NameTypeDefaultDescription
adjust'increase' | 'decrease' | 'remove''increase'The adjustment for a cart line's quantity. Valid values are 'increase', 'decrease', or 'remove'.
otherPropsObjectAny other props accepted by the underlying button component.

Notes

  • Ensure that the CartLineQuantityAdjustButton component is a descendant of both the CartLineProvider and CartProvider components to access necessary cart data.
  • The CartLineQuantityAdjustButton component internally utilizes the useCart and useCartLine hooks to access cart-related functions and data.