Bouncy dial
A gauge whose arc overshoots slightly and springs back whenever a new reading arrives.
JSON 9 lines
{
"type": "gauge",
"id": "speed",
"position": [0, 0],
"label": "Speed",
"min": 0,
"max": 100,
"animation": "bouncy"
}2 fields, each with what it does.
| Field | Type | Default | What it does |
|---|---|---|---|
profileprofile | text | — | The style of motion Picks the named motion (snappy, smooth, bouncy, gentle or instant) used when the control's value changes. |
durationduration | number0–10step 0.1 | — | How long the motion lasts Overrides the profile's length in seconds; zero is immediate and instant stays immediate. |
3 examples, each one a control you can paste into a layout.
A gauge whose arc overshoots slightly and springs back whenever a new reading arrives.
{
"type": "gauge",
"id": "speed",
"position": [0, 0],
"label": "Speed",
"min": 0,
"max": 100,
"animation": "bouncy"
}A toggle that uses the smooth spring stretched to half a second when it flips.
{
"type": "toggle",
"id": "fan",
"position": [0, 1],
"label": "Fan",
"animation": { "profile": "smooth", "duration": 0.5 }
}A gauge that jumps straight to each new value with no travel.
{
"type": "gauge",
"id": "level",
"position": [1, 0],
"label": "Level",
"min": 0,
"max": 100,
"animation": "instant"
}| Name | SwiftUI |
|---|---|
snappy |
Spring: 0.25 seconds, bounce 0.1 |
smooth |
Spring: 0.35 seconds, bounce 0.15 |
bouncy |
Spring: 0.5 seconds, bounce 0.3 |
gentle |
.easeInOut(duration: 0.6) |
instant |
.linear(duration: 0) |
"animation": "bouncy"
Or custom:
"animation": { "profile": "smooth", "duration": 0.5 }
A custom duration of zero (or a negative duration) is immediate. The instant profile stays immediate even with a duration override. Non-finite durations fall back to the profile default.
Toggle switches honor animation overrides for taps, remote state changes, and drag release or cancellation. Their default is a spring with response 0.32 and damping 0.64. Curved toggle knobs and radial slider thumbs follow their tracks during animation. Dragging follows the finger immediately; Reduce Motion disables these travel animations.
gentle for show/hideGenerated from ControlDocs/animations.md. Something unclear or missing? Tell me.