Skip to main content


The CartLineQuantity component renders a span element (or the type of HTML element specified by the as prop) with the cart line's quantity. It must be a descendent of a CartLineProvider component.

Example code

import {CartLineProvider, useCart, CartLineQuantity} from '@shopify/hydrogen';

export function App() {
const {lines} = useCart();

return => {
return (
<CartLineProvider key={} line={line}>
<CartLineQuantity />


asTTagAn HTML tag to be rendered as the base element wrapper. The default is div.

Component type

The CartLineQuantity component is a client component, which means that it renders on the client. For more information about component types, refer to React Server Components.