---
title: ActivityAttributes
framework: activitykit
role: symbol
role_heading: Protocol
path: activitykit/activityattributes
---

# ActivityAttributes

The protocol you implement to describe the content of a Live Activity.

## Declaration

```swift
protocol ActivityAttributes : Decodable, Encodable
```

## Mentioned in

Displaying live data with Live Activities Launching your app from a Live Activity Starting and updating Live Activities with ActivityKit push notifications

## Overview

Overview The ActivityAttributes protocol describes the content that appears in your Live Activity. Its inner type ContentState represents the dynamic content of the Live Activity. The following example shows an implementation of the ActivityAttributes protocol for a pizza delivery app. The app’s Live Activity shows the number of ordered pizzas and the total amount on the bill as static data and the name of the driver and an estimated delivery time as dynamic data that changes over time. Note how the implementation defines the type alias PizzaDeliveryStatus to make the code more descriptive and easier to read. public import Foundation import ActivityKit

struct PizzaDeliveryAttributes: ActivityAttributes {     public typealias PizzaDeliveryStatus = ContentState

public struct ContentState: Codable, Hashable {         var driverName: String         var deliveryTimer: ClosedRange<Date>     }

var numberOfPizzas: Int     var totalAmount: String     var orderNumber: String }

## Topics

### Dynamic content

- [ContentState](activitykit/activityattributes/contentstate.md)

### Instance Methods

- [previewContext(_:isStale:viewKind:)](activitykit/activityattributes/previewcontext(_:isstale:viewkind:).md)

## Relationships

### Inherits From

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)

## See Also

### Starting a Live Activity

- [request(attributes:content:pushType:)](activitykit/activity/request(attributes:content:pushtype:).md)
- [request(attributes:content:pushType:style:)](activitykit/activity/request(attributes:content:pushtype:style:).md)
- [request(attributes:content:pushType:style:alertConfiguration:start:)](activitykit/activity/request(attributes:content:pushtype:style:alertconfiguration:start:).md)
- [request(attributes:content:pushType:style:alertConfiguration:startDate:)](activitykit/activity/request(attributes:content:pushtype:style:alertconfiguration:startdate:).md)
- [attributes](activitykit/activity/attributes.md)
- [ActivityStyle](activitykit/activitystyle.md)
- [content](activitykit/activity/content.md)
- [ActivityContent](activitykit/activitycontent.md)
- [Activity.ContentState](activitykit/activity/contentstate-swift.typealias.md)
- [PushType](activitykit/pushtype.md)
- [ActivityAuthorizationError](activitykit/activityauthorizationerror.md)
