Button
Button, a React Native component for iOS, Android and web: Five variants, three sizes, a loading state, and IconButton.
Usage
import { useState } from 'react';
import { Button } from './components/ui/button';
import { Stack } from './components/ui/stack';
export default function Example() {
const [saving, setSaving] = useState(false);
return (
<Stack direction="horizontal" gap={2} wrap align="center">
<Button>Solid</Button>
<Button variant="soft">Soft</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="danger">Danger</Button>
<Button disabled>Disabled</Button>
<Button loading={saving} onPress={() => { setSaving(true); setTimeout(() => setSaving(false), 1500); }}>Save</Button>
</Stack>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | ||
variant | ButtonVariant | 'solid' | |
size | ControlSize | 'md' | |
loading | boolean | false | Shows a spinner, blocks presses, and announces busy. The label stays, so the width does not jump. |
fullWidth | boolean | false | |
start | ReactNode | ||
end | ReactNode | ||
style | StyleProp<ViewStyle> | ||
labelStyle | StyleProp<TextStyle> | ||
native | boolean | Renders the real platform button when `@leoanimesh/ferrule-native` is available. Needs a text label and no `start` or `end`. | |
children | ReactNode | The icon, like `<Icon source={...} />`. | |
'aria-label' | string | Required, because there is no visible text to name it. | |
nativeIcon | { ios?: string; android?: string } | Icon names for the platform button, an SF Symbol on iOS. With `native`, iOS 26+ draws a Liquid Glass button and iOS 17 to 25 the system one. Elsewhere `children` draws. |