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-haptics

Usage

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

PropTypeDefaultDescription
iconGlyphName | (color, size) => ReactNodeA built-in glyph, or a function that draws your own icon in the colour and size it is given.
accessibilityLabelstringRequired: 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.
disabledbooleanfalseDims it and ignores taps.