Mobile › Inputs
IconButton
A round button with only an icon, in four variants and three sizes. Small ones keep a full touch target.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { IconButton } from "plankui-mobile";
<IconButton icon="plus" variant="filled" accessibilityLabel="Add" onPress={add} />
<IconButton icon={(color, size) => <Ionicons name="heart" color={color} size={size} />} accessibilityLabel="Like" />API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | GlyphName | (color, size) => ReactNode | A built-in glyph, or a function that draws your own icon in the colour and size it is given. | |
| accessibilityLabel | string | Required: an icon alone has no name for screen readers. | |
| onPress | () => void | – | Called on tap, with a light haptic. |
| variant | 'plain' | 'tinted' | 'filled' | 'outline' | 'tinted' | How much it stands out. |
| size | 'sm' | 'md' | 'lg' | 'md' | 32, 40 or 52 pt across. |
| disabled | boolean | false | Dims it and ignores taps. |