Form Submit

GitHub

Submit button that reflects the pending state of the nearest Form.

Installation

bash
pnpm dlx shadcn@latest add @cs/form-submit

Usage

tsx
import { FormSubmit } from "@/components/cs/form-submit"
tsx
<FormSubmit label="Save" />

API Reference

FormSubmit

Submit button that reflects the pending state of the nearest Form.

Props

NameTypeDefaultDescription
buttonClassNamestring-Additional class name for the field wrapper.
buttons(ComponentPropsWithoutRef<typeof Button> & { label?: string; icon?: ReactNode })[]-Buttons placed to the left of the main submit button. For more flexibility, you can use children.
childrenReactNode-The content placed to the left of the main submit button. If you only need another button, use the buttons parameter.
iconReactNode-Icon displayed before the main submit button label.
label *string-Text displayed in the main submit button.
size"icon" | "default" | "xs" | "lg" | "sm" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined--
variant"link" | "default" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined--