SelectedVariantMetafield

The SelectedVariantMetafield component renders a Metafield component with the selected product's metafield. It must be a descendent of a ProductProvider component.

Example code

Props

Name Type Description
keyName string A string corresponding to the key of the selected variant's metafield.
namespace string A string corresponding to the namespace of the selected variant's metafield.
children? ReactNode A render function that takes a Metafield object as its argument.

Component type

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