# FormActions

A form footer with grouped actions and space for operation feedback.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, FormActions, Button } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <FormActions primary={<Button type="submit">Save</Button>} secondary={<Button type="reset" variant="subtle">Discard changes</Button>} />
    </FloodRoot>
  );
}
```

## Design notes

- Use at the end of a native form. Pass existing Button components with explicit submit, reset or button types. The host owns validation, submission and reset.
- Keep the primary action at the end of its action group. Feedback can sit alongside it on wide layouts and move to a separate line when space runs out.
- Use layout=status-below to keep action and feedback alignment while reserving one line for the status slot. Use layout=stacked for full-width buttons in a narrow form. The action order stays the same.
- Use the status slot for brief operation feedback such as SaveStatus. Keep field errors attached to their fields and put longer errors above the action row.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `primary` | `ReactNode` | `Required` |
| `secondary` | `ReactNode` | `—` |
| `status` | `ReactNode` | `—` |
| `align` | `"start" \| "end"` | `"end"` |
| `layout` | `"auto" \| "status-below" \| "stacked"` | `"auto"` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children">` | `Forwarded` |
