---
title: "accessibilityQuickAction(style:content:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/accessibilityquickaction(style:content:)"
---

# accessibilityQuickAction(style:content:)

Adds a quick action to be shown by the system when active.

## Declaration

```swift
nonisolated func accessibilityQuickAction<Style, Content>(style: Style, @ContentBuilder content: () -> Content) -> some View where Style : AccessibilityQuickActionStyle, Content : View

```

## Discussion

Discussion The quick action will automatically become active when the view appears. If the view is disabled, the action will defer becoming active until the view is no longer disabled. The following example shows how to add a quick action to pause and resume a workout, with the prompt style. @State private var isPaused = false

var body: some View {     WorkoutView(isPaused: $isPaused)         .accessibilityQuickAction(style: .prompt) {             Button(isPaused ? "Resume" : "Pause") {                 isPaused.toggle()             }         } } The following example shows how to add a quick action to play and pause music, with the outline style. @State private var isPlaying = false

var body: some View {     PlayButton(isPlaying: $isPlaying)         .contentShape(.focusEffect, Circle())         .accessibilityQuickAction(style: .outline) {             Button(isPlaying ? "Pause" : "Play") {                 isPlaying.toggle()             }         } }

## See Also

### Offering Quick Actions to people

- [accessibilityQuickAction(style:isActive:content:)](swiftui/view/accessibilityquickaction(style:isactive:content:).md)
- [AccessibilityQuickActionStyle](swiftui/accessibilityquickactionstyle.md)
