---
title: WebPage.BackForwardList
framework: webkit
role: symbol
role_heading: Structure
path: webkit/webpage/backforwardlist-swift.struct
---

# WebPage.BackForwardList

An observable representation of a webpage’s previously loaded resources.

## Declaration

```swift
@MainActor struct BackForwardList
```

## Overview

Overview This type can be used to facilitate navigating to prior or subsequent loaded resources and for observing when new entries get added or removed. In this example, the back-forward list is used to create a SwiftUI View to facilitate navigating to previous or next items: private struct BackForwardMenuView: View {     struct LabelConfiguration {         let text: String         let systemImage: String     }

let list: [WebPage.BackForwardList.Item]     let label: LabelConfiguration     let navigateToItem: (WebPage.BackForwardList.Item) -> Void

var body: some View {         Menu {             ForEach(list) { item in                 Button(item.title ?? item.url.absoluteString) {                     navigateToItem(item)                 }             }         } label: {             Label(label.text, systemImage: label.systemImage)                 .labelStyle(.iconOnly)         } primaryAction: {             navigateToItem(list.first!)         }         .disabled(list.isEmpty)     } } The view can then be used for both the back and forward list using a specific WebPage: struct ContentView: some View {     @State private var page = WebPage()

var body: some View {         WebView(page)             .toolbar {                 ToolbarItemGroup {                     ToolbarBackForwardMenuView(                         list: page.backForwardList.backList.reversed(),                         label: .init(text: "Backward", systemImage: "chevron.backward")                     ) {                         viewModel.page.load($0)                     }

ToolbarBackForwardMenuView(                         list: page.backForwardList.forwardList,                         label: .init(text: "Forward", systemImage: "chevron.forward")                     ) {                         viewModel.page.load($0)                     }                 }             }     } } Because backForwardList is an observable property, the states of these buttons are automatically updated.

## Topics

### Structures

- [WebPage.BackForwardList.Item](webkit/webpage/backforwardlist-swift.struct/item.md)

### Instance Properties

- [backList](webkit/webpage/backforwardlist-swift.struct/backlist.md)
- [currentItem](webkit/webpage/backforwardlist-swift.struct/currentitem.md)
- [forwardList](webkit/webpage/backforwardlist-swift.struct/forwardlist.md)

### Subscripts

- [subscript(_:)](webkit/webpage/backforwardlist-swift.struct/subscript(_:).md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Observing navigation between webpages

- [WebPage.NavigationEvent](webkit/webpage/navigationevent.md)
