---
title: "PasteButton | Explore SwiftUI"
description: "A system button that reads items from the pasteboard and delivers it to a closure. Learn how to use PasteButton in SwiftUI with visual code examples."
canonical_url: "https://exploreswiftui.com/library/button/pastebutton"
meta:
  author: "Explore SwiftUI"
  "og:description": "A system button that reads items from the pasteboard and delivers it to a closure. Learn how to use PasteButton in SwiftUI with visual code examples."
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_PasteButton%2Cdescription_A%2Bsystem%2Bbutton%2Bthat%2Breads%2Bitems%2Bfrom%2Bthe%2Bpasteboard%2Band%2Bdelivers%2Bit%2Bto%2Ba%2Bclosure.%2Ccategory_Button%2Cimage_~L2FwaS9pbWFnZXMvMzUvdmFyaWFudHMvMjM1P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ2aXNpb25PUyJdfQ%2Cp_Ii9saWJyYXJ5L2J1dHRvbi9wYXN0ZWJ1dHRvbiI%2Cs_MqIKtP_skGxqkp8i.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "PasteButton | Explore SwiftUI"
  "twitter:description": "A system button that reads items from the pasteboard and delivers it to a closure. Learn how to use PasteButton in SwiftUI with visual code examples."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_PasteButton%2Cdescription_A%2Bsystem%2Bbutton%2Bthat%2Breads%2Bitems%2Bfrom%2Bthe%2Bpasteboard%2Band%2Bdelivers%2Bit%2Bto%2Ba%2Bclosure.%2Ccategory_Button%2Cimage_~L2FwaS9pbWFnZXMvMzUvdmFyaWFudHMvMjM1P3Y9MTc5MDA3MzQ3ODg0MiZyPTImdz0xMjgwJnE9ODUmZj1qcGVn%2CimageMode_crop%2CimagePosition_center%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgdG9wOiA3NXB4OyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkIHJnYmEoMCwwLDAsMC4wNik7IGJvcmRlci10b3AtbGVmdC1yYWRpdXM6IDMycHg7IGJvcmRlci1ib3R0b20tbGVmdC1yYWRpdXM6IDMycHg7%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwibWFjT1MiLCJ2aXNpb25PUyJdfQ%2Cp_Ii9saWJyYXJ5L2J1dHRvbi9wYXN0ZWJ1dHRvbiI%2Cs_MqIKtP_skGxqkp8i.png"
  "twitter:title": "PasteButton | Explore SwiftUI"
---

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

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

# **PasteButton**

A system button that reads items from the pasteboard and delivers it to a closure.

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

### **Platform Compatibility**

iOS 16.0+ iPadOS 16.0+ macOS 10.15+ visionOS 1.0+

### **Tags**

### **SwiftUI Code**

[ Docs](https://developer.apple.com/documentation/swiftui/pastebutton)

```
@State private var pastedText: String = ""

var body: some View {
    PasteButton(payloadType: String.self) { strings in
        pastedText = strings[0]
    }
}
```

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

Created: May 30, 2025Updated: December 27, 2025

![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)

### **More Button Components **

[**View all **](https://exploreswiftui.com/library/button)

![Button Sizing - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/190/variants/3?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Button Sizing**

The preferred sizing behavior of buttons in the view hierarchy.

![Role Button With Default Label - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/134/variants/424?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Role Button With Default Label**

Creates a button that displays a default label.

![Glass Button Styles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/87/variants/314?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Glass Button Styles**

A button style that applies glass border artwork based on the button’s context

![RenameButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/37/variants/213?v=1790073478842&r=2&w=412&q=75&f=webp)

### **RenameButton**

A button that triggers a standard rename action

![EditButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/36/variants/239?v=1790073478842&r=2&w=412&q=75&f=webp)

### **EditButton**

A button that toggles the edit mode environment value

![Button Tint - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/34/variants/408?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Button Tint**

Sets the buttons tint color

![Button Roles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/33/variants/718?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Button Roles**

A value that describes the purpose of a button.

![Button Border Shape - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/32/variants/179?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Button Border Shape**

A shape used to draw a button’s border.

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![Min Max Current Value Gauge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/40/variants/231?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Min Max Current Value Gauge**

Creates a gauge showing a value within a range and describes the gauge’s current, minimum, and maximum values

![Content Unavailable - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/4/variants/37?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Content Unavailable**

A placeholder for empty results with optional button

![GroupBox Background - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/29/variants/190?v=1790073478842&r=2&w=412&q=75&f=webp)

### **GroupBox Background**

Set a custom GroupBox background

![UIKit Label Colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/10/variants/45?v=1790073478842&r=2&w=412&q=75&f=webp)

### **UIKit Label Colors**

![ContainerRelativeShape - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/98/variants/318?v=1790073478842&r=2&w=412&q=75&f=webp)

### **ContainerRelativeShape**

A shape that is replaced by an inset version of the current container shape. If no container shape was defined, is replaced by a rectangle

![List Row Separator Tint - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/117/variants/291?v=1790073478842&r=2&w=412&q=75&f=webp)

### **List Row Separator Tint**

Sets the tint color associated with a row.

![Music Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/232/variants/727?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Music Picker**

Presents a music picker to select items from the Apple Music catalog and the user’s music library.

![Navigation Container Background - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/172/variants/529?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Navigation Container Background**

Sets the container background of the enclosing container using a view.

```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/button/pastebutton#webpage","@type":"WebPage","dateModified":"2025-12-27T17:39:22.543Z","datePublished":"2025-05-30T14:33:02.634Z","description":"A system button that reads items from the pasteboard and delivers it to a closure. Learn how to use PasteButton in SwiftUI with visual code examples.","name":"PasteButton","url":"https://exploreswiftui.com/library/button/pastebutton","breadcrumb":{"@id":"https://exploreswiftui.com/library/button/pastebutton#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/button/pastebutton"]}],"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/button/pastebutton#article","dateModified":"2025-12-27T17:39:22.543Z","datePublished":"2025-05-30T14:33:02.634Z","description":"A system button that reads items from the pasteboard and delivers it to a closure. Learn how to use PasteButton in SwiftUI with visual code examples.","headline":"PasteButton","inLanguage":"en-US","name":"PasteButton","thumbnailUrl":"https://exploreswiftui.com/api/images/35/variants/235?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/button/pastebutton","@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/button/pastebutton#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/button/pastebutton#/schema/software-source-code/1","@type":"SoftwareSourceCode","codeRepository":"https://developer.apple.com/documentation/swiftui/pastebutton","codeSampleType":"full example","description":"A system button that reads items from the pasteboard and delivers it to a closure. Learn how to use PasteButton in SwiftUI with visual code examples.","name":"PasteButton SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"@State private var pastedText: String = \"\"\n\nvar body: some View {\n    PasteButton(payloadType: String.self) { strings in\n        pastedText = strings[0]\n    }\n}","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Button"},{"@type":"Thing","name":"PasteButton"}]},{"@id":"https://exploreswiftui.com/library/button/pastebutton#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"Button","item":"https://exploreswiftui.com/library/button","position":2},{"@type":"ListItem","name":"PasteButton","item":"https://exploreswiftui.com/library/button/pastebutton","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/35/variants/235?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/35/variants/235?v=1790073478842&r=2"}]}
```