Skip to main content

CartLineProductTitle

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

Example code

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

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

return lines.map((line) => {
return (
<CartLineProvider key={line.id} line={line}>
<CartLineProductTitle />
</CartLineProvider>
);
});
}

Props

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

Component type

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