Mobile › Inputs
Button
Four weights for a screen's actions, from the filled main action to a plain text button, with loading and danger states.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { Button } from "plankui-mobile";
<Button block size="lg" loading={saving} onPress={save}>Save changes</Button>
<Button variant="tinted">Add to list</Button>
<Button variant="outline">Share</Button>
<Button variant="plain">Skip</Button>
<Button tone="danger">Delete</Button>iOS and Android
iOS: Rounded rectangles with 17 pt semibold labels; a light tap haptic on press.
Android: Material 3 pill buttons with 14 sp medium labels and a ripple.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | The label. | |
| onPress | () => void | – | Called on tap. |
| variant | "filled" | "tinted" | "outline" | "plain" | "filled" | Main, second, third action, or text only. |
| tone | "accent" | "danger" | "accent" | Danger for destructive actions. |
| size | "sm" | "md" | "lg" | "md" | lg suits the one action at the bottom of a screen. |
| icon | ReactNode | – | An icon before the label. |
| loading | boolean | false | Shows a spinner and blocks taps. |
| disabled | boolean | false | Dims and blocks taps. |
| block | boolean | false | Stretch to the full width. |
| accessibilityLabel | string | label | Override what screen readers say. |
| style | StyleProp<ViewStyle> | – | Outer style. |