Skip to main content

clientAction

A client-side mutation function that runs in the browser, allowing you to handle form submissions entirely on the client or augment server action behavior.

Signature

ClientActionFunctionArgs
required
Arguments passed to the clientAction function
Data | Promise<Data>
Data returned to the UI (accessible via useActionData())

Basic Example

Calling Server Action

Client-Only Mutations

Validation Before Server

Optimistic UI Updates

Offline Support

Client-Side Caching

File Upload with Progress

Analytics and Tracking

Multi-Step Forms

Best Practices

Perfect for operations that don’t need server involvement:
Avoid unnecessary server requests with client-side validation:
Provide feedback when server is unreachable:
Only use optimistic UI when failures are rare:

See Also