# Haptic feedback

> Haptic feedback is a tap, tick or vibration the device plays in answer to a touch. iOS plays it for switches, sliders and pickers on its own, and Android offers APIs for adding it to events.

Page: https://www.appetiteui.com/glossary/haptic-feedback. Haptic feedback in mobile UI: iOS and Android. Also called Haptics, Tactile feedback, Vibration.

## Why it matters

A haptic confirms a touch without a look, which helps when hands are busy. It is a supplement: it can be off or unsupported, so it must not be the only signal.

System components already play haptics, so a custom control is the place to add one.

## iOS and Android

|  | iOS | Android (Material 3) | Appetite UI |
| --- | --- | --- | --- |
| Name | Playing haptics | Haptic feedback, Android haptics APIs | Not drawn |
| Automatic | Switches, sliders and pickers on supported iPhone models | Added to events through the haptics APIs | See below |
| Role | In addition to visual and auditory feedback | Designed with the haptic design principles of the guide | See below |

## In Appetite UI

The kit does not draw haptics. A prototype can only show that a control reacts; the haptic is added in code.

## Example

A custom rating control plays a light tick as the finger crosses each star, and the stars also fill, so the feedback does not depend on the vibration.

## Common mistakes

- Haptics on every tap, which numbs the effect.
- Haptics as the only confirmation.
- Replacing the system haptics of standard controls.
- A strong haptic for a minor event.

## Questions

### Do standard iOS controls play haptics?

Yes. Apple notes that components like switches, sliders and pickers play haptic feedback automatically on supported iPhone models.

### Can I rely on haptics alone?

No. They depend on the device and the settings, so pair them with a visual or sound signal.

## Sources

1. [Apple Human Interface Guidelines: Playing haptics](https://developer.apple.com/design/human-interface-guidelines/playing-haptics)
2. [Android Developers: Haptics](https://developer.android.com/develop/ui/views/haptics)

## Related

- Docs: [Toggle](https://www.appetiteui.com/docs/toggle)
- Docs: [Slider](https://www.appetiteui.com/docs/slider)
- Glossary: [Toggle and switch](https://www.appetiteui.com/glossary/toggle-switch)
- Glossary: [Slider](https://www.appetiteui.com/glossary/slider)
- Glossary: [Motion, easing and duration](https://www.appetiteui.com/glossary/motion)
