Skip to content

Components

FormActions

Component reference

Properties

Use FormActions

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

Example import style
form-actions.tsxTSX
"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

PropValuesDefault
primaryReactNodeRequired
secondaryReactNode—
statusReactNode—
align"start" | "end""end"
layout"auto" | "status-below" | "stacked""auto"
Native HTML propsOmit<HTMLAttributes<HTMLDivElement>, "children">Forwarded
View TypeScript source