The user wants a "microinteraction feedback toolkit" designed.
This toolkit needs to map three specific types of feedback:
- Motion specs (animation/transition details).
- Haptic cues (vibration/tactile feedback).
- Sound design (audio feedback).
It needs to be cross-platform (implied: Web, iOS, Android, perhaps Desktop).
Key Goal: Create a system that ensures consistency and quality of microinteractions (small, functional animations/effects) across different devices and operating systems.
Structure of the Response:
- Concept/Name: Give it a catchy name to make it feel real (e.g., "Haptix" or "Flux").
- Core Philosophy: Define what the toolkit achieves (consistency, accessibility, expressiveness).
- The Mapping Matrix: This is the core request. I need to show how to map a single interaction to these three modalities.
- System Architecture: How is this built? (Tokens, Components, API).
- Platform-Specific Implementation: How do the specs translate to Swift/Kotlin/CSS?
- The Design Tool (UI Concept): Describe the interface designers/developers would use.
- Accessibility & Settings: Crucial for modern design systems.
Drafting the Content - Section by Section:
-
Name: Let's go with "Resonance". Sounds tactile and auditory.
-
The Framework (The "Atomic" Unit):
I need to define a standard object structure. Let's call it the Feedback Token.
- Trigger: What starts it (e.g., Tap, Success, Error).
- Motion: Duration, Easing, Scale/Transform.
- Haptics: Intensity, Sharpness (iOS) vs. Duration/Amplitude (Android).
- Sound: Pitch, Timbre, Decay.
-
The Mapping Table (The "Meat"):
I'll create a table to visualize the mapping for common interactions.
- Interaction: Success (e.g., Sent Message).
- Motion: Bounce in, overshoot.
- Haptic: Double tap / 'Click'.
- Sound: Pop/Chirp.
- Interaction: Error (Shake to reject).
- Interaction: Pull to Refresh.
-
Platform Parity (The technical challenge):
- iOS: Core Haptics, UIView.animate.
- Android: VibratorManager, SpringAnimation.
- Web: Web Vibration API (limited), CSS Motion Path / Web Animations API, Howler.js/Tone.js for sound.
-
Tooling/UI:
- A Figma plugin makes sense. It exports JSON.
- A "Tester" app for mobile to feel the haptics.
-
Accessibility:
- Reduce Motion -> Crossfade.
- Reduce Haptics -> Off.
- Sound Off -> Muted.
-
Refining the "Motion Specs":
- Need to mention Easing curves (Bezier) and Durations.
- Concept: "Synesthetic Mapping" - High pitch usually maps to small/light motion. Low pitch/heavy vibration maps to slow/heavy motion.
-
Refining "Haptics":
- iOS has "Haptic Types" (Impact, Notification, Selection). Android is more raw (Primitives). The toolkit needs to abstract this.
- Abstraction: "Heavy Impact" -> iOS:
.heavy, Android: PRIMITIVE_TICK, High Amplitude.
-
Refining "Sound":
- Needs to be subtle. "UI Sounds" not "Game SFX".
Structuring the output for readability:
Use bold headers, lists, and code blocks for the JSON structure. A visual table (markdown) is essential.
Self-Correction/Review during drafting:
- Initial thought: Just list CSS and Swift code.
- Correction: The prompt asks for a design of a toolkit. It needs to be high-level system design, not just code snippets. It needs to explain the logic of the mapping.
- Focus: Emphasize the cross-platform aspect. How do you translate an iPhone Taptic Engine feel to a generic Android vibrator? You need a fallback hierarchy.
Final Polish:
Organize into:
- System Overview
- The Feedback Token (The Data Structure)
- The Mapping Logic (The Translation Layer)
- Scenario Examples
- Accessibility/Controls
- Implementation Guide
Let's write it out.
This is a design specification for "Resonance," a cross-platform microinteraction feedback toolkit. This system ensures that a button press, a "like" action, or an error state feels physically and audibly consistent, whether the user is on iOS, Android, or Web.
The "Resonance" System
Version: 1.0
Principle: Synesthetic Consistency.
The goal is to translate the physics of the digital world into tactile (haptic), visual (motion), and auditory (sound) stimuli that feel like a single, cohesive event.
1. The Atomic Unit: The Feedback Token
Instead of defining animations and sounds separately, Resonance uses a Feedback Token. This is a JSON object that defines an interaction by its "Weight" and "State."
The Token Structure
{
"token_name": "interaction_primary_tap",
"physics_profile": {
"weight": "medium", // light, medium, heavy
"stiffness": 400, // Spring tension
"damping": 25 // Resistance
},
"mappings": {
"motion": { ... },
"haptic": { ... },
"sound": { ... }
}
}
2. The Mapping Matrix
This is the core logic of the toolkit. It translates the Physics Profile into platform-specific execution.
A. Motion Specs (Visual)
The motion is driven by spring physics to ensure organic movement.
| Interaction Type | Motion Curve (Web/iOS) | Android Interpolator | Visual Behavior |
|---|
| Gentle (Light) | damping: 20, stiffness: 300 | anticipateOvershootInterpolator | Scale: 0.95 → 1.02 → 1.0 |
| Bouncy (Playful) | damping: 10, stiffness: 200 | bounceInterpolator | Scale: 1.0 → 0.8 → 1.2 → 1.0 |
| Stiff (Serious) | damping: 30, stiffness: 500 | fastOutSlowIn | Scale: 1.0 → 0.98 → 1.0 (Immediate snap) |
| Success (Confirmation) | damping: 15, stiffness: 180 | N/A (Path Morph) | Checkmark draw-in + Scale Pop |
B. Haptic Cues (Tactile)
Mapping abstract physics to specific hardware APIs.
| Physics Profile | iOS (UINotificationFeedbackGenerator) | Android (VibrationEffect) | Web (Gamepad API / Mobile) |
|---|
| Impact (Light) | .impact(.light) | EFFECT_TICK | Duration: 10ms |
| Impact (Medium) | .impact(.medium) | EFFECT_CLICK | Duration: 20ms, Sharp rise |
| Impact (Heavy) | .impact(.heavy) | EFFECT_HEAVY_CLICK | Duration: 40ms, Heavy rumble |
| Success | .notificationOccurred(.success) | EFFECT_DOUBLE_CLICK | Pulse: Short-Pause-Short |
| Error | .notificationOccurred(.error) | Custom Pattern: [0, 20, 40, 80] | Rumble: Triple staccato |
C. Sound Design (Auditory)
Sounds are synthesized (not recorded samples) to ensure they are lightweight and feel "mathematical."
| State | Sonic Character | Frequency (Hz) | Envelope | Asset Format |
|---|
| Tap Down | Soft Thock | 200-400 (Low Pass) | Fast Attack, Fast Decay (50ms) | .mp3 / .ogg |
| Tap Up (Trigger) | Clean Click / Pop | 800-1200 | Medium Attack, Medium Decay (100ms) | .mp3 / .ogg |
| Success | Ascending Chime | C5 → E5 → G5 | Overlapping Sine Waves | .wav (Lossless) |
| Error | Dissonant Buzz | 150Hz + 155Hz (Interference) | 200ms Gated | .wav |
| Refresh | "Swoosh" | White Noise Sweep | High Pass Filter Sweep | .mp3 |
3. Scenario Implementation
Here is how the toolkit applies the mapping to specific UI elements.
Scenario 1: The "Like" Button (Heart)
A playful, rewarding interaction.
- Motion: The button scales down to 0.8 on press, then snaps to 1.3 with a slight overshoot (elasticity) before settling at 1.0. A particle explosion (mini-hearts) follows.
- Haptic:
- iOS/Android:
Impact Medium on press, followed by a double-tick Click rhythm upon release.
- Sound: A synthesized "pop" sound with a slight reverberant tail, pitched slightly random (+/- 5%) to sound organic.
Scenario 2: Swipe to Delete
A heavy, dangerous interaction implying destruction.
- Motion: The item tilts slightly (3D perspective) as it is dragged. Upon release, it accelerates rapidly off-screen to the left.
- Haptic:
- Trigger: Ramping up intensity as the user drags past the threshold.
- Action:
Impact Heavy + Effect Tick (grinding sensation) when the action commits.
- Sound: A low-frequency "rumble" that rises in pitch as the threshold is breached, ending in a sharp "swish" or "tear" sound.
Scenario 3: Pull to Refresh
A suspenseful loading interaction.
- Motion: The spinner rotates, stretching slightly with elasticity.
- Haptic: A "tic-toc" pattern (reciprocating vibration) synced with the rotation of the spinner dial.
- Sound: Subtle "grinding" or "water droplet" ambient sounds, looped.
4. Accessibility & System Architecture
The toolkit includes an accessibility layer that overrides the physics profile based on user system settings.
The Filter Layer
Before the Feedback Token is executed, it passes through the Accessibility Filter:
-
Reduce Motion (iOS/Web) / Remove Animations (Android):
- Motion Override: Disables spring overshoot. Fades elements in/out instantly (0ms opacity).
- Haptic Override: Increases intensity to compensate for lack of visual cues.
-
Haptics Off:
- Sound Override: Adds a subtle "thump" to button sounds to replace the missing tactile feedback.
-
Silent Mode:
- Haptic Override: Synchronizes haptic intensity to match the amplitude of the disabled sound (translating loud sounds into strong vibrations).
5. Toolkit Component Library (For Developers)
The Resonance Toolkit is delivered as a library (Swift Package, Kotlin Library, NPM Module).
Code Example (Pseudo-code):
// Triggering the interaction
Resonance.trigger('button_primary', {
velocity: event.velocity, // Pass touch speed for physics calculation
location: event.coords // For spatial audio/haptics
});
Output:
- Audio Engine: Plays
btn_primary_pop.ogg with volume scaled to velocity.
- Haptic Engine: Fires
ImpactMedium on iOS/Gamepad or EFFECT_CLICK on Android.
- Motion Engine: Applies a CSS Spring animation or UIKit Animation with the defined damping ratio.