IconButton is a square Pressable that shows one icon. It takes the same variant values as Button and handles taps with onPress. See the web IconButton page for more on when to use it.
An icon alone tells a screen reader nothing, so give every IconButton an aria-label. Without one, and without children, it logs a warning.
size takes xs to xl, from 20 to 48 points square. m (32 points) is the default. Every size takes taps from a 44 point area. rounded makes it a circle.
The icon follows the variant. For an icon in a colour of its own, pass an Icon with onBackground as the children, as core 3.0 does for 2.x's color. Children replace the icon, for an element of your own.
- No tooltip. There is no hover on a touch screen. tooltip is still accepted and becomes the accessible name when aria-label is not set.
- onPress. Taps go to onPress, as on any Pressable. There is no onClick or href.
- Pressed, not hover. The variant's pressed colours show while the finger is down.
IconButton also takes every React Native Pressable prop except children and style, which it replaces.