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

PropTypeDefaultDescription
childrenReactNode
variantButtonVariant'solid'
sizeControlSize'md'
loadingbooleanfalseShows a spinner, blocks presses, and announces busy. The label stays, so the width does not jump.
fullWidthbooleanfalse
startReactNode
endReactNode
styleStyleProp<ViewStyle>
labelStyleStyleProp<TextStyle>
nativebooleanRenders the real platform button when `@leoanimesh/ferrule-native` is available. Needs a text label and no `start` or `end`.
childrenReactNodeThe icon, like `<Icon source={...} />`.
'aria-label'stringRequired, 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.