---
title: "Apple TV SwiftUI Gallery | Explore SwiftUI"
description: "Browse available Apple TV SwiftUI screenshots, code, and Apple documentation as the gallery grows."
canonical_url: "https://exploreswiftui.com/tv"
meta:
  author: "Explore SwiftUI"
  "og:description": "Browse available Apple TV SwiftUI screenshots, code, and Apple documentation as the gallery grows."
  "og:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_Apple%2BTV%2BSwiftUI%2BLayouts%2Cdescription_Browse%2Bavailable%2BSwiftUI%2Bpreviews%2Bfor%2BApple%2BTV.%2Cp_Ii90diI%2Cs_njpK0jhDtOboUL1K.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Apple TV SwiftUI Gallery | Explore SwiftUI"
  "twitter:description": "Browse available Apple TV SwiftUI screenshots, code, and Apple documentation as the gallery grows."
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Default%2Ctitle_Apple%2BTV%2BSwiftUI%2BLayouts%2Cdescription_Browse%2Bavailable%2BSwiftUI%2Bpreviews%2Bfor%2BApple%2BTV.%2Cp_Ii90diI%2Cs_njpK0jhDtOboUL1K.png"
  "twitter:title": "Apple TV SwiftUI Gallery | Explore SwiftUI"
---

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

# **Apple TV SwiftUI layouts**

Browse available Apple TV SwiftUI screenshots, code, and Apple documentation as new previews are published.

****15****elements

**Button**

## **Button Roles**

A value that describes the purpose of a button.

Explore Button Roles on Apple TV, with SwiftUI code and Apple API documentation.

### **SwiftUI code **

[ Full details](https://exploreswiftui.com/library/button/button-roles?os=tvos&design=liquid&bezel=on) [ Docs](https://developer.apple.com/documentation/swiftui/buttonrole)

```
VStack {
    HStack {
        Button("Tap Me", role: .cancel, action: action)
            .buttonStyle(.plain)
        Button("Tap Me", role: .cancel, action: action)
            .buttonStyle(.borderless)
        Button("Tap Me", role: .cancel, action: action)
            .buttonStyle(.bordered)
        Button("Tap Me", role: .cancel, action: action)
            .buttonStyle(.borderedProminent)
    }
    HStack {
        Button("Tap Me", role: .destructive, action: action)
            .buttonStyle(.plain)
        Button("Tap Me", role: .destructive, action: action)
            .buttonStyle(.borderless)
        Button("Tap Me", role: .destructive, action: action)
            .buttonStyle(.bordered)
        Button("Tap Me", role: .destructive, action: action)
            .buttonStyle(.borderedProminent)
    }
}
```

### **Compatibility **

**iOS 15.0+ ****iPadOS 15.0+ ****macOS 12.0+ ****watchOS 8.0+ ****tvOS 15.0+ ****visionOS 1.0+ **

### **Tags **

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

## **All variants **

Every available Apple TV screenshot for Button Roles.

2 views

```json
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://exploreswiftui.com/tv#collectionpage","name":"Apple TV SwiftUI Gallery","description":"Browse available Apple TV SwiftUI screenshots, code, and Apple documentation as the gallery grows.","url":"https://exploreswiftui.com/tv","inLanguage":"en-US","isPartOf":{"@id":"https://exploreswiftui.com/#website"},"about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"Apple TV"}],"mainEntity":{"@id":"https://exploreswiftui.com/tv#itemlist"}},{"@type":"ItemList","@id":"https://exploreswiftui.com/tv#itemlist","name":"SwiftUI APIs and components with Apple TV previews","numberOfItems":15,"itemListElement":[{"@type":"ListItem","position":1,"name":"Button Roles","url":"https://exploreswiftui.com/tv?element=33"},{"@type":"ListItem","position":2,"name":"Toggle","url":"https://exploreswiftui.com/tv?element=208"},{"@type":"ListItem","position":3,"name":"SwitchToggleStyle","url":"https://exploreswiftui.com/tv?element=211"},{"@type":"ListItem","position":4,"name":"Page Screen Sheet Size","url":"https://exploreswiftui.com/tv?element=144"},{"@type":"ListItem","position":5,"name":"Item Sheet","url":"https://exploreswiftui.com/tv?element=136"},{"@type":"ListItem","position":6,"name":"Boolean Sheet","url":"https://exploreswiftui.com/tv?element=135"},{"@type":"ListItem","position":7,"name":"Placeholder Icon Product View","url":"https://exploreswiftui.com/tv?element=204"},{"@type":"ListItem","position":8,"name":"Custom Icon Product View","url":"https://exploreswiftui.com/tv?element=203"},{"@type":"ListItem","position":9,"name":"Product View","url":"https://exploreswiftui.com/tv?element=202"},{"@type":"ListItem","position":10,"name":"CompactProductViewStyle","url":"https://exploreswiftui.com/tv?element=207"},{"@type":"ListItem","position":11,"name":"RegularProductViewStyle","url":"https://exploreswiftui.com/tv?element=206"},{"@type":"ListItem","position":12,"name":"Restore Purchases Button","url":"https://exploreswiftui.com/tv?element=217"},{"@type":"ListItem","position":13,"name":"Group Subscription Store View","url":"https://exploreswiftui.com/tv?element=227"},{"@type":"ListItem","position":14,"name":"Single Subscription Store View","url":"https://exploreswiftui.com/tv?element=226"},{"@type":"ListItem","position":15,"name":"Subscription Store View","url":"https://exploreswiftui.com/tv?element=225"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://exploreswiftui.com"},{"@type":"ListItem","position":2,"name":"Apple TV","item":"https://exploreswiftui.com/tv"}]}]}
```

```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/tv#webpage","@type":"WebPage","description":"Browse available Apple TV SwiftUI screenshots, code, and Apple documentation as the gallery grows.","name":"Apple TV SwiftUI Gallery","url":"https://exploreswiftui.com/tv","isPartOf":{"@id":"https://exploreswiftui.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/tv"]}],"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/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"}]}
```