ButtonSubmit

A form submit button that displays loading and success state.

It implements the <Button> component.

Styles

Import the styles within a Next.js custom app in pages/_app.js.
import "device-agnostic-ui/ButtonSubmit.css";
Also import the styles for the components this component implements.
import "device-agnostic-ui/Button.css";
import "device-agnostic-ui/Loading.css";

Props

success

TypeBoolean (optional)
Defaultfalse

When true and the loading prop is false, sets the <button> element’s disabled attribute and indicates success with a tick icon.

...props

Type…* (optional)

Additional props for the container; a <Button> component.

Examples

How to import.
import ButtonSubmit from "device-agnostic-ui/ButtonSubmit.mjs";
Submit button.
import ButtonSubmit from "device-agnostic-ui/ButtonSubmit.mjs";

const result = <ButtonSubmit>Submit</ButtonSubmit>;
If the form submission is loading.
import ButtonSubmit from "device-agnostic-ui/ButtonSubmit.mjs";

const result = <ButtonSubmit loading>Submit</ButtonSubmit>;
If the form submission was successful.
import ButtonSubmit from "device-agnostic-ui/ButtonSubmit.mjs";

const result = <ButtonSubmit success>Submit</ButtonSubmit>;

Tags