<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CarPlay",
  "identifier" : "/documentation/CarPlay/CPListItem/init(text:detailText:image:accessoryImage:accessoryType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "CarPlay"
    ],
    "preciseIdentifier" : "c:objc(cs)CPListItem(im)initWithText:detailText:image:accessoryImage:accessoryType:"
  },
  "title" : "init(text:detailText:image:accessoryImage:accessoryType:)"
}
-->

# init(text:detailText:image:accessoryImage:accessoryType:)

Creates a list item that displays an accessory beside its content.

```
init(text: String?, detailText: String?, image: UIImage?, accessoryImage: UIImage?, accessoryType: CPListItemAccessoryType)
```

## Parameters

`text`

The list item’s primary text.

`detailText`

The list item’s secondary text.

`image`

The image that the list item displays in its leading region.

`accessoryImage`

The image that the list item displays in its trailing region.

`accessoryType`

The accessory that the list item displays in its trailing region.

## Discussion

If you specify an image, CarPlay sets `accessoryType` to [`CPListItemAccessoryType.none`](/documentation/CarPlay/CPListItemAccessoryType/none).

Provide an image that is display-ready. If necessary, provide light and dark variants using an asset catalog, or use an instance of <doc://com.apple.documentation/documentation/UIKit/UIImageAsset> and register an image for each interface style. To properly size your image, use the display scale of the vehicle’s primary screen, which you access from your interface controller’s [`carTraitCollection`](/documentation/CarPlay/CPInterfaceController/carTraitCollection) property. At runtime, use [`maximumImageSize`](/documentation/CarPlay/CPListItem/maximumImageSize) to determine the maximum size for a list item’s image and accessory image.

CarPlay doesn’t support animated images. If you provide an animated image, CarPlay uses only the first image in the animation sequence.

---

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)