Docs
AI

Assistant Orb

A dark glass ball with a Siri-style voice wave inside, drawn by a Metal shader and locked to the thinking state.

$npx swiftpieces add AssistantOrb
Free · MIT + Commons ClauseiOS 17.0+Metalaiorbshadermetalthinking
Type
AssistantOrb
Files
AssistantOrb.swift, AssistantOrb.metal
Depends on
Nothing (Apple frameworks only)
Version
1.2.0

The assistant's mark while it thinks. Copy AssistantOrb.metal alongside this file; its assistantOrbSiriWave kernel compiles into your app's default Metal library.

Notes

  • Requires AssistantOrb.metal in the same target. The [[ stitchable ]] assistantOrbSiriWave function is looked up through ShaderLibrary at runtime. Its helpers live in the assistantOrbSiri namespace, so it can share a target with other orb kernels.
  • The orb has one look: thinking. Four thin sine membranes in blue, pink, orange and red travel left to right through the equator over a violet ground, seen through a refracting glass shell with a cool and warm rim. There is no idle or speaking phase, no audio level and no touch interaction. Colour is the only input: palette defaults to .siri, and AssistantOrb.Palette(bands:ground:crest:rimCool:rimWarm:) takes hex values or Colors for your brand. A palette change crossfades all eight colours on a calm spring, so a second change mid-fade turns from the colours on screen; under Reduce Motion it is a short colour fade. The motion never changes.
  • The sphere never scales, floats or pulses; only the wave inside it moves. It has no entrance of its own, so it arrives with whatever presents it. Put the orb on a dark surface and pair it with your own status copy if the step changes.
  • size sets a square frame. The ball fills 90% of it, so leave the frame square.
  • The clock restarts each time the orb appears, so the wave always enters on the same first pose and Float precision holds over long sessions.
  • Under Reduce Motion the wave rests on that first pose: a still frame that nothing moves or dims, and a palette change only recolours it in place. Your status copy carries the sense of progress there. Turning Reduce Motion off lets the wave flow on from that pose without a jump.
  • VoiceOver reads "Assistant" with "Thinking" as its value.

Usage

VStack(spacing: 20) {
    AssistantOrb(size: 180, palette: .siri)
    Text("Thinking")
        .font(.subheadline)
        .foregroundStyle(.secondary)
}
// One weight for every string, as in the rest of the library.
.fontWeight(.semibold)
.padding(32)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.black)

Parameters

ParameterDescription
sizeDiameter of the ball in points. 160 by default; the view is always a square of this side.
paletteThe eight colours of the wave, ground, crest and rim. .siri by default; build your own with Palette(bands:ground:crest:rimCool:rimWarm:) from hex or Color. A change crossfades on a calm spring.

Install

Pick one. Run it from the folder that contains your .xcodeproj and the files land inside your app.

Terminal

$npx swiftpieces add AssistantOrb

Or ask your coding agent · Claude Code, Cursor or Xcode, once the MCP server is connected

>Add the SwiftPieces "Assistant Orb" piece to my app

Or copy the source above into your app.

New to SwiftUI?If you know React, CSS or Tailwind, SwiftUI is easier to pick up than it looks.Try real app patterns first

Building a whole app? See SwiftPieces Pro →

All ai →

Build it yourself: SwiftUI loading states guide · SwiftUI animations guide

On this page

SwiftPiecesPro

Build the whole app with one library.

Production-ready screens, whole flows, complete app templates, a Build Kit your agent follows and Pro remixing.

54 screens · 46 patterns · 48 flows · 12 templates · 31 Build Kit skills

Explore Pro