Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

FormSubmit

A customizable submit button connected to the pending state of Form.

Customize the pending indicator

Create the form state with useForm, then keep FormSubmit inside Form. This complete example awaits a local operation and replaces the default ring with a colored dots Spinner.

FormSubmit — a submit button with a custom loader

FormSubmit belongs inside Form and inherits Button's presentation props: variant, appearance, size, radius, fullWidth, icons, className, style and classNames. Form owns type=submit and loading through isSubmitting, so an asynchronous onSubmit drives the pending state automatically.

Provide loadingIndicator to replace the ring. Configure the Spinner's appearance and variant to change its shape and color, or supply your own decorative content. classNames.spinner styles its wrapper independently of the label. Omit the prop for the default ring, or pass null to hide the visual. This new prop awaits the next package release.

FormSubmit — a submit button with a custom loaderOpen preview

Integration notes

The loadingIndicator prop is available in 0.1.0-beta.4. See Usage and API reference below for the supported inherited Button props.

New to Pimolu? Follow the Quick start or the Next.js guide for the shared stylesheet and application provider.

Preview

Live preview

Changes apply to this preview only.

Loading the interactive example?

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Button appearances

Reuse Button's presentation props while Form owns submission.

Open preview

Explicitly disable submission

Keep a submit action unavailable until the user accepts a condition.

Open preview

Text-only pending feedback

Hide the decorative loader and keep a readable pending label.

Open preview

Named-part customization

Target the submit button label and loader without changing the shared Button styles.

Open preview

Usage

Place FormSubmit inside Form. It renders a Button with type=submit and reads form.isSubmitting automatically. Return or await your asynchronous work in useForm's onSubmit so the pending state lasts until that work completes.

Use Button's variant, appearance, size, radius, fullWidth, icons, disabled, className and style props. Do not pass type or loading: Form owns both. Prevent submission through validation rather than running business logic in onClick.

loadingIndicator accepts a decorative Spinner or custom React content. Configure Spinner's appearance, size and variant to change its shape and color. Omission keeps the ring; null/false hides the visual while retaining disabled and aria-busy. This prop ships in 0.1.0-beta.4.

Use classNames.root, label and spinner for named-part customization. Form-level classNames.submit styles the submit button; prefer the page's local classes when several forms need different treatments.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluFormSubmitProps

Type source
PimoluFormSubmitProps public API
NameTypeDefaultDescription
classNamesPimoluClassNames<"form"> | undefined—Additive classes for stable named parts, including composed descendants. Parts: endIcon, error, label, root, spinner, startIcon, submit. Parts render only when the corresponding component or state is present.
childrenReactNode"Submit"Public Pimolu prop; see the source declaration for details.
onChangeChangeEventHandler<HTMLButtonElement, Element> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLButtonElement> | undefined—Standard React/HTML attribute.
variant"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined—Variant exposed by this component.
appearance"solid" | "soft" | "outline" | "ghost" | "link" | "dashed" | "glass" | "elevated" | "glow" | "text" | undefined—Visual treatment of the control or surface.
size"xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined—Component size.
radius"sm" | "md" | "lg" | "none" | "full" | undefined—Corner-radius treatment.
endIconReactNode—Decorative content after the label or input.
startIconReactNode—Decorative content before the label or input.
disabledboolean | undefined—Standard React/HTML attribute.
namestring | undefined—Standard React/HTML attribute.
valuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
loadingIndicatorReactNode—Replaces the decorative loader while loading. undefined keeps the default ring; null/false hides it.
fullWidthboolean | undefined—Use the available width of the parent.
iconOnlyboolean | undefined—Render an icon-only action. Provide an accessible name with aria-label.
classNames

PimoluClassNames<"form"> | undefined

No default extracted.

Additive classes for stable named parts, including composed descendants. Parts: endIcon, error, label, root, spinner, startIcon, submit. Parts render only when the corresponding component or state is present.

children

ReactNode

Default: "Submit"

Public Pimolu prop; see the source declaration for details.

onChange

ChangeEventHandler<HTMLButtonElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onClick

MouseEventHandler<HTMLButtonElement> | undefined

No default extracted.

Standard React/HTML attribute.

variant

"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined

No default extracted.

Variant exposed by this component.

appearance

"solid" | "soft" | "outline" | "ghost" | "link" | "dashed" | "glass" | "elevated" | "glow" | "text" | undefined

No default extracted.

Visual treatment of the control or surface.

size

"xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined

No default extracted.

Component size.

radius

"sm" | "md" | "lg" | "none" | "full" | undefined

No default extracted.

Corner-radius treatment.

endIcon

ReactNode

No default extracted.

Decorative content after the label or input.

startIcon

ReactNode

No default extracted.

Decorative content before the label or input.

disabled

boolean | undefined

No default extracted.

Standard React/HTML attribute.

name

string | undefined

No default extracted.

Standard React/HTML attribute.

value

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

loadingIndicator

ReactNode

No default extracted.

Replaces the decorative loader while loading. undefined keeps the default ring; null/false hides it.

fullWidth

boolean | undefined

No default extracted.

Use the available width of the parent.

iconOnly

boolean | undefined

No default extracted.

Render an icon-only action. Provide an accessible name with aria-label.

Accessibility

  • Keep an explicit action label. During submission the button is disabled and exposes aria-busy. A decorative loader does not replace a readable pending or completion message.
  • Use a polite status message for the result. Do not nest interactive controls inside loadingIndicator. Pimolu Spinner supports reduced motion; custom animations must honor that preference too.
Read the accessibility guide →