Skip to main content


The CartLineProvider component creates a context for using a cart line.

Example code

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

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

return => {
return (
<CartLineProvider key={} line={line}>
{/* Your JSX */}


childrenReactNodeAny ReactNode elements.
lineCart['lines'][1]A cart line object.

Component type

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