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

Usage

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

PropTypeDefaultDescription
childrenstringThe 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.
iconReactNode–An icon before the label.
loadingbooleanfalseShows a spinner and blocks taps.
disabledbooleanfalseDims and blocks taps.
blockbooleanfalseStretch to the full width.
accessibilityLabelstringlabelOverride what screen readers say.
styleStyleProp<ViewStyle>–Outer style.