Money

The Money component renders a string of the Storefront API's MoneyV2 object according to the locale in the shopify.config.js file. If children is a function, then it will provide render props for the children corresponding to the object returned by the useMoney hook.

Example code

Props

Name Type Description
as? ElementType A ReactNode element.
money MoneyV2 A MoneyV2 object.
children? ReactNode A function that takes an object return by the useMoney hook and returns a ReactNode.

Component type

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

GraphQL fragment

The following fragment is available as a string for your GraphQL query using MoneyFragment or Money.Fragment. Using this fragment ensures that you have all the data necessary for rendering the Money component.