# FormActions

> Molecule — orn-ui

> ⚠️ Requires <UIProvider>: This component (like every orn-ui component) must render inside a <UIProvider> ancestor, or it throws at runtime. See https://orn-ui-docs.vercel.app/getting-started.md

> Runs on Expo SDK 54, 55, 56 and 57, and on bare React Native >=0.81 with react >=19.1. No native modules — works in Expo Go, no prebuild.

## Installation

Install just this component (copies the source into your project, no npm dependency)
```bash
npx orn-ui add form-actions
```

Or install the whole package and import it
```tsx
pnpm add orn-ui
import { FormActions } from 'orn-ui/form-actions';
```

Depends on: core (theme + icons), button

## Variants

### Primary + secondary

```tsx
<FormActions primaryLabel="Save" onPrimaryPress={() => {}} onSecondaryPress={() => {}} />
```

### Secondary only

```tsx
<FormActions secondaryLabel="Close" onSecondaryPress={() => {}} />
```

### Primary disabled

```tsx
<FormActions primaryLabel="Save" onPrimaryPress={() => {}} primaryDisabled onSecondaryPress={() => {}} />
```

### Primary loading

```tsx
<FormActions primaryLabel="Saving..." onPrimaryPress={() => {}} primaryLoading onSecondaryPress={() => {}} />
```

## Full demo source

```tsx
const variants: VariantDef[] = [
  { label: 'Primary + secondary', content: <FormActions primaryLabel="Save" onPrimaryPress={() => {}} onSecondaryPress={() => {}} /> },
  { label: 'Secondary only', content: <FormActions secondaryLabel="Close" onSecondaryPress={() => {}} /> },
  {
    label: 'Primary disabled',
    content: <FormActions primaryLabel="Save" onPrimaryPress={() => {}} primaryDisabled onSecondaryPress={() => {}} />,
  },
  {
    label: 'Primary loading',
    content: <FormActions primaryLabel="Saving..." onPrimaryPress={() => {}} primaryLoading onSecondaryPress={() => {}} />,
  },
];
return <VariantList variants={variants} />;
```

## Props

| Name | Type | Default | Description |
|---|---|---|---|
| `primaryLabel?` | `string` | — | If omitted, only the secondary button is shown. |
| `onPrimaryPress?` | `() => void` | — | — |
| `primaryDisabled?` | `boolean` | false | — |
| `primaryLoading?` | `boolean` | false | — |
| `primaryLeftIconName?` | `IconName` | — | — |
| `secondaryLabel?` | `string` | — | — |
| `onSecondaryPress` | `() => void` | — | — |
| `style?` | `StyleProp<ViewStyle>` | — | — |
