Every form needs a way to submit, andDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/rijvi-mahmud/shaddy/llms.txt
Use this file to discover all available pages before exploring further.
SubmitButton provides a consistent, accessible submit control that works out of the box with ShaddyForm. It renders a shadcn/ui Button with type="submit", supports loading and disabled states, and accepts a custom label, loading label, and icons — making it straightforward to reflect async submission progress.
Installation
Props
The text displayed on the button in its default (non-loading) state.
The text displayed when
isLoading is true. Replaces label during the loading state.When
true, renders the loadingLabel instead of label, displays the loadingIcon with a spin animation, and disables the button to prevent duplicate submissions.Disables the button without changing its label. Use this when the form should not be submitted for a reason other than an ongoing request (e.g., a required acceptance checkbox is unchecked).
An icon element rendered before the
label in the default state. Any React node is accepted — typically a Lucide icon component.An icon element rendered with a CSS spin animation when
isLoading is true. Typically a spinner or loading icon.Additional CSS classes applied to the button element. Merged with the component’s own classes (
w-full gap-2) using cn.All other props from the
shadcn/ui Button component are forwarded — including variant, size, and any HTML button attributes.Basic Usage
PlaceSubmitButton anywhere inside a ShaddyForm. No additional wiring is needed — it uses type="submit" and relies on the form’s native submit event.
With Loading State
Track your async submission and pass the result toisLoading to give users clear feedback while the request is in flight.
When
isLoading is true, the button renders as disabled regardless of the disabled prop value. This prevents double-submission without requiring any additional state management.