<!--
{
  "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/StoreView",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "StoreKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:17_StoreKit_SwiftUI0A4ViewV"
  },
  "title" : "StoreView"
}
-->

# StoreView

A view that merchandises a collection of In-App Purchase products.

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

## Overview

A `StoreView` displays a collection of in-app purchase products, including their localized names, descriptions, and prices, and displays a purchase button.

Create a store view by providing a collection of product identifiers for the view to load from the App Store, or a collection of [`Product`](/documentation/StoreKit/Product) values you previously loaded. If you provide product identifiers, the store view automatically loads the product information from the App Store, and updates the view when the products are available.

You can provide a view to use as an icon or image for each individual product. If you provide product identifiers, you can optionally provide placeholder icons 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 display those images for your products.

### Manage the store layout

The `StoreView` arranges products in rows. If the view has enough horizontal space available, the store adds columns. In tvOS, the view arranges the products in columns and adds rows as space permits.

The store view grows to fit its container, and scrolls when the container doesn’t have enough space to display all the products. Use the <doc://com.apple.documentation/documentation/SwiftUI/View/fixedSize(horizontal:vertical:)> modifier to change this behavior.

To achieve a custom layout, you can compose [`ProductView`](/documentation/StoreKit/ProductView) instances with other container views instead of using the `StoreView`.

### Customize the store

You can customize the store by displaying additional buttons, and applying styles.

To display a button that syncs in-app purchase entitlements with the App Store, modify the in-app store view or an ancestor view using the `storeButton(_:for:)` modifier with the parameters <doc://com.apple.documentation/documentation/SwiftUI/Visibility/visible> and [`restorePurchases`](/documentation/StoreKit/StoreButtonKind/restorePurchases). The app calls the [`sync()`](/documentation/StoreKit/AppStore/sync()) method when people use this button.

You can customize the appearance of the products using product view styles, such as [`CompactProductViewStyle`](/documentation/StoreKit/CompactProductViewStyle), [`LargeProductViewStyle`](/documentation/StoreKit/LargeProductViewStyle), and [`RegularProductViewStyle`](/documentation/StoreKit/RegularProductViewStyle). To apply the style, call the <doc://com.apple.documentation/documentation/SwiftUI/View/productViewStyle(_:)> modifier.

## Topics

### Creating store views that load products

[`init(ids:prefersPromotionalIcon:)`](/documentation/StoreKit/StoreView/init(ids:prefersPromotionalIcon:))

Creates a view to load and merchandise a collection of products from the App Store using product identifiers.

[`init(ids:prefersPromotionalIcon:icon:)`](/documentation/StoreKit/StoreView/init(ids:prefersPromotionalIcon:icon:))

Creates a view to load a collection of products from the App Store using product identifiers, and merchandise them using a custom image.

[`init(ids:prefersPromotionalIcon:icon:placeholderIcon:)`](/documentation/StoreKit/StoreView/init(ids:prefersPromotionalIcon:icon:placeholderIcon:))

Creates a view to load a collection of products from the App Store using product identifiers, and merchandise them using an image and a custom placeholder icon.

[`init(ids:icon:placeholderIcon:)`](/documentation/StoreKit/StoreView/init(ids:icon:placeholderIcon:))

Creates a view to load a collection of products from the App Store using product identifiers, and merchandise them using their promotional images and a custom placeholder icon.

### Creating store views with preloaded products

[`init(products:prefersPromotionalIcon:)`](/documentation/StoreKit/StoreView/init(products:prefersPromotionalIcon:))

Creates a view to load and merchandise a collection of products from the App Store.

[`init(products:prefersPromotionalIcon:icon:)`](/documentation/StoreKit/StoreView/init(products:prefersPromotionalIcon:icon:))

Creates a view to merchandise a collection of products using a custom icon.

[`init(products:icon:)`](/documentation/StoreKit/StoreView/init(products:icon:))

Creates a view to merchandise a collection of products with promotional images.

### Loading promotional images

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

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

## Relationships

### Conforms To

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

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

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

---

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)