SnippetIntent PRO
SnippetIntent is a special kind of AppIntent whose purpose is to render interactive Snippet UI cards inside the Shortcuts app (iOS 26+).
Key characteristics:
- Must be registered in
app_intents.tsx - Must specify
protocol: AppIntentProtocol.SnippetIntent perform()must return a VirtualNode (TSX UI)- Must be returned via
Intent.snippetIntent() - Must be invoked from the Shortcuts action “Show Snippet Intent”
- SnippetIntent is ideal for building interactive, step-based UI inside a Shortcut
It is not a data-returning Intent; it is exclusively for UI rendering in Shortcuts.
2. System Requirements
SnippetIntent requires iOS 26 or later.
On iOS versions earlier than 26:
Intent.snippetIntent()is not availableIntent.requestConfirmation()cannot be used- The Shortcuts action “Show Snippet Intent” does not exist
- SnippetIntent-type AppIntents cannot be invoked by Shortcuts
3. Registering a SnippetIntent (app_intents.tsx)
Example:
Another SnippetIntent:
Requirements:
protocolmust beAppIntentProtocol.SnippetIntentperform()must return a TSX UI (VirtualNode)- SnippetIntent cannot return non-UI types such as text, numbers, JSON, or file paths
4. Wrapping SnippetIntent Return Values — Intent.snippetIntent
A SnippetIntent cannot be passed directly to Script.exit().
It must be wrapped in a IntentSnippetIntentValue.
Type Definition
This wrapper makes the return value compatible with the Shortcuts “Show Snippet Intent” action.
5. Snippet Confirmation UI — Intent.requestConfirmation
iOS 26 Snippet Framework provides built-in confirmation UI driven by SnippetIntent.
API
ConfirmationActionName
A predefined list of semantic action names used by system UI:
Example
Execution behavior:
- Displays a Snippet UI for confirmation
- If the user confirms → Promise resolves and script continues
- If the user cancels → execution stops (system-driven behavior)
6. The “Show Snippet Intent” Action in Shortcuts (iOS 26+)
iOS 26 adds a new Shortcuts action:
Show Snippet Intent
This action is the only correct way to display SnippetIntent UI.
Comparison with Other Scripting Actions
Usage
- Add “Show Snippet Intent” in Shortcuts
- Select a Scripting script project
- The script must return
Intent.snippetIntent(...) - Shortcuts renders the UI in a Snippet card
7. IntentMemoryStorage — Cross-Intent State Store
Why It Exists
Every AppIntent execution runs in an isolated environment:
- After an AppIntent
perform()completes → its execution context is destroyed - After a script calls
Script.exit()→ the JS context is destroyed
This means local variables cannot persist between AppIntent calls.
Snippet flows commonly involve: PickColor → SetColor → ShowResult
Therefore a cross-Intent state mechanism is required.
IntentMemoryStorage API
Purpose
- Store small pieces of shared data across multiple AppIntents
- Works during the entire Shortcut flow
- Ideal for selections, temporary configuration, or intent-to-intent handoff
Example
Guidelines
Not recommended for large data. For large data:
- Use
Storage(persistent key-value store) - Or save files via
FileManagerinappGroupDocumentsDirectory
IntentMemoryStorage should be treated as temporary, lightweight state.
8. Full Example Combining All Features (iOS 26+)
app_intents.tsx
intent.tsx
Shortcuts Flow
- User provides text
- “Show Snippet Intent” runs the script
- Script displays PickColorIntent confirmation UI via requestConfirmation
- After confirmation, displays ShowResultIntent Snippet UI
- Uses IntentMemoryStorage to persist the selected color
9. Summary
This document introduces all new Scripting features added for iOS 26+:
-
SnippetIntent
- Registered using
AppIntentManager - Returns TSX UI
- Requires iOS 26+
- Registered using
-
Intent.snippetIntent
- Wraps a SnippetIntent for Script.exit
-
Intent.requestConfirmation
- Presents a confirmation Snippet UI
- Requires SnippetIntent
-
“Show Snippet Intent” action in Shortcuts
- Required to display SnippetIntent UI
-
IntentMemoryStorage
- Lightweight cross-AppIntent storage
- Not suitable for large binary/content data
- Complements multi-step Snippet flows
