---
title: "Swipe Action | Explore SwiftUI"
description: "Adds custom swipe actions to a row in a list or container, notifying you when the actions are revealed or dismissed"
canonical_url: "https://exploreswiftui.com/library/view/swipe-action"
meta:
  author: "Explore SwiftUI"
  "og:description": "Adds custom swipe actions to a row in a list or container, notifying you when the actions are revealed or dismissed"
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Swipe%2BAction%2Cdescription_~QWRkcyBjdXN0b20gc3dpcGUgYWN0aW9ucyB0byBhIHJvdyBpbiBhIGxpc3Qgb3IgY29udGFpbmVyLCBub3RpZnlpbmcgeW91IHdoZW4gdGhlIGFjdGlvbnMgYXJlIHJldmVhbGVkIG9yIGRpc21pc3NlZC4%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjAwL3ZhcmlhbnRzLzMyMj92PTE3OTAwNzM0Nzg4NDImcj0yJnc9MTI4MCZxPTg1JmY9anBlZw%2CimagePosition_center%2CimageMode_crop%2CimageFrame_~Ym9yZGVyLXJhZGl1czogMjZweCAyNnB4IDBweCAwcHg7IGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci1ib3R0b206IDA7IGJveC1zaGFkb3c6IDAgLTEwcHggNTBweCByZ2JhKDM3LDk5LDIzNSwwLjE4KTs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L3ZpZXcvc3dpcGUtYWN0aW9uIg%2Cs_PtttLYPYIz3V5m3h.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Swipe Action | Explore SwiftUI"
  "twitter:description": "Adds custom swipe actions to a row in a list or container, notifying you when the actions are revealed or dismissed"
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Swipe%2BAction%2Cdescription_~QWRkcyBjdXN0b20gc3dpcGUgYWN0aW9ucyB0byBhIHJvdyBpbiBhIGxpc3Qgb3IgY29udGFpbmVyLCBub3RpZnlpbmcgeW91IHdoZW4gdGhlIGFjdGlvbnMgYXJlIHJldmVhbGVkIG9yIGRpc21pc3NlZC4%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjAwL3ZhcmlhbnRzLzMyMj92PTE3OTAwNzM0Nzg4NDImcj0yJnc9MTI4MCZxPTg1JmY9anBlZw%2CimagePosition_center%2CimageMode_crop%2CimageFrame_~Ym9yZGVyLXJhZGl1czogMjZweCAyNnB4IDBweCAwcHg7IGJvcmRlcjogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci1ib3R0b206IDA7IGJveC1zaGFkb3c6IDAgLTEwcHggNTBweCByZ2JhKDM3LDk5LDIzNSwwLjE4KTs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ3YXRjaE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L3ZpZXcvc3dpcGUtYWN0aW9uIg%2Cs_PtttLYPYIz3V5m3h.png"
  "twitter:title": "Swipe Action | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[ iPhone](https://exploreswiftui.com/iphone?element=200)

# **Swipe Action**

Adds custom swipe actions to a row in a list or container, notifying you when the actions are revealed or dismissed.

![Swipe Action - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/200/variants/322?v=1790073478842&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 27.0+ iPadOS 27.0+ macOS 27.0+ watchOS 27.0+ visionOS 27.0+

### **Tags**

### **SwiftUI Code**

[ Docs](<https://developer.apple.com/documentation/swiftui/view/swipeactions(edge:allowsfullswipe:content:onpresentationchanged:)>)

```
@State private var isSwiped = false

var body: some View {
    VStack {
        Text("Trailing Swipe")
            .swipeActions {
                Button(role: .destructive, action: action)
            }
         Text("Leading Swipe")
             .swipeActions(edge: .leading) {
                 Button(role: .destructive, action: action)
             }
          Text("Stateful Swipe")
              .swipeActions {
                  Button(role: .destructive, action: action)
              } onPresentationChanged: {
                  isSwiped = $0
              }
           Text("Swipe state: \(isSwiped ? "active" : "inactive")")
    }
}
```

### **Found an issue or have a suggestion?**

Created: June 18, 2026Updated: June 18, 2026

![Connect Wizard](https://exploreswiftui.com/_ipx/f_webp&q_80&s_48x48/images/connect-wizard-icon.png)

**Connect Wizard**

**Unlock insights App Store Connect doesn’t show you.**

[** Get Started **](https://apps.apple.com/app/apple-store/id6747314580?pt=121213751&ct=Explore%20SwiftUI%20Banner&mt=8)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/swipe-action#webpage","@type":"WebPage","dateModified":"2026-06-18T21:00:48.937Z","datePublished":"2026-06-18T20:18:47.760Z","description":"Adds custom swipe actions to a row in a list or container, notifying you when the actions are revealed or dismissed","name":"Swipe Action","url":"https://exploreswiftui.com/library/view/swipe-action","breadcrumb":{"@id":"https://exploreswiftui.com/library/view/swipe-action#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/view/swipe-action"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/view/swipe-action#article","dateModified":"2026-06-18T21:00:48.937Z","datePublished":"2026-06-18T20:18:47.760Z","description":"Adds custom swipe actions to a row in a list or container, notifying you when the actions are revealed or dismissed","headline":"Swipe Action","inLanguage":"en-US","name":"Swipe Action","thumbnailUrl":"https://exploreswiftui.com/api/images/200/variants/322?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/view/swipe-action","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@type":"WebSite","name":"Explore SwiftUI","url":"https://exploreswiftui.com"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/view/swipe-action#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/swipe-action#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/view/swipeactions(edge:allowsfullswipe:content:onpresentationchanged:)","codeSampleType":"full example","description":"Adds custom swipe actions to a row in a list or container, notifying you when the actions are revealed or dismissed","name":"Swipe Action SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"@State private var isSwiped = false\n\nvar body: some View {\n    VStack {\n        Text(\"Trailing Swipe\")\n            .swipeActions {\n                Button(role: .destructive, action: action)\n            }\n         Text(\"Leading Swipe\")\n             .swipeActions(edge: .leading) {\n                 Button(role: .destructive, action: action)\n             }\n          Text(\"Stateful Swipe\")\n              .swipeActions {\n                  Button(role: .destructive, action: action)\n              } onPresentationChanged: {\n                  isSwiped = $0\n              }\n           Text(\"Swipe state: \\(isSwiped ? \"active\" : \"inactive\")\")\n    }\n}\n","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"View"},{"@type":"Thing","name":"Swipe Action"}]},{"@id":"https://exploreswiftui.com/library/view/swipe-action#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"View","item":"https://exploreswiftui.com/library/view","position":2},{"@type":"ListItem","name":"Swipe Action","item":"https://exploreswiftui.com/library/view/swipe-action","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/200/variants/322?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/200/variants/322?v=1790073478842&r=2"}]}
```