<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/ProductView",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "StoreKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:17_StoreKit_SwiftUI11ProductViewV"
  },
  "title" : "ProductView"
}
-->

# ProductView

A view that merchandises an individual In-App Purchase product.

```
@MainActor @preconcurrency struct ProductView<Icon, PlaceholderIcon> where Icon : View, PlaceholderIcon : View
```

## Overview

A `ProductView` shows information about an in-app purchase product, including its localized name, description, and price, and displays a purchase button.

You create a product view by providing a product identifier to load from the App Store, or a [`Product`](/documentation/StoreKit/Product) value you previously loaded. If you provide a product identifier, the view loads the product’s information from the App Store automatically, and updates the view when the product is available.

You can customize the view by providing a view to use as an icon, or image, for the in-app purchase product. If you provide a product identifier, you can optionally provide a placeholder icon for the system to use instead of the automatic placeholder icon. If you set up promoted images for your products in App Store Connect, you can choose to use those images as the icon.

You can customize the product view’s appearance using the standard styles, including the [`CompactProductViewStyle`](/documentation/StoreKit/CompactProductViewStyle), [`RegularProductViewStyle`](/documentation/StoreKit/RegularProductViewStyle), and [`LargeProductViewStyle`](/documentation/StoreKit/LargeProductViewStyle) styles. Apply the style using the <doc://com.apple.documentation/documentation/SwiftUI/View/productViewStyle(_:)> view modifier.

You can also create your own custom styles by creating styles that conform to the [`ProductViewStyle`](/documentation/StoreKit/ProductViewStyle) protocol.

## Topics

### Creating product views that load products

[`init(id:prefersPromotionalIcon:)`](/documentation/StoreKit/ProductView/init(id:prefersPromotionalIcon:))

Creates a view to load and merchandise an individual product from the App Store.

[`init(id:prefersPromotionalIcon:icon:)`](/documentation/StoreKit/ProductView/init(id:prefersPromotionalIcon:icon:))

Creates a view to load an individual product from the App Store and merchandise it using a custom icon.

[`init(id:prefersPromotionalIcon:icon:placeholderIcon:)`](/documentation/StoreKit/ProductView/init(id:prefersPromotionalIcon:icon:placeholderIcon:))

Creates a view to load an individual product from the App Store and merchandise it using an image and a custom placeholder icon.

[`init(id:icon:placeholderIcon:)`](/documentation/StoreKit/ProductView/init(id:icon:placeholderIcon:))

Creates a view to load an individual product from the App Store, and merchandise it using its promotional image and a custom placeholder icon.

### Creating product views with preloaded products

[`init(_:prefersPromotionalIcon:icon:)`](/documentation/StoreKit/ProductView/init(_:prefersPromotionalIcon:icon:))

Creates a view to merchandise an individual product using a custom icon.

[`init(_:prefersPromotionalIcon:)`](/documentation/StoreKit/ProductView/init(_:prefersPromotionalIcon:))

Creates a view to merchandise an individual product.

[`init(_:icon:)`](/documentation/StoreKit/ProductView/init(_:icon:))

Creates a view to display a product that the system already loaded from the App Store, and merchandise it using its promotional image.

### Creating product views with a configuration

[`init(_:)`](/documentation/StoreKit/ProductView/init(_:))

Creates a view to merchandise an individual product using a configuration for product view style.

### Loading promotional images

[`ProductIconPhase`](/documentation/StoreKit/ProductIconPhase)

The current phase of the asynchronous loading operation of a product’s promotional image.

### Supporting types

[`AutomaticProductPlaceholderIcon`](/documentation/StoreKit/AutomaticProductPlaceholderIcon)

A view that represents the default placeholder icon for an in-app store product.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`View`](/documentation/SwiftUI/View)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)