FormikSubmitButton
Basic Usage
The FormikSubmitButton internally leverages the Formik context with the useFormikContext() hook to get the isSubmitting state. This is used to disable the button while submitting in addition to showing a linear loader. Since the type is set to submit you can simply drop in the FormikSubmitButton and the rest will be taken care of by the component.
import { FormikSubmitButton } from '@krakentech/coral-formik';
import { Formik, Form } from 'formik';
<Formik>
<Form method="post">
...
<FormikSubmitButton>Submit</FormikSubmitButton>
</Form>
</Formik>;loadingLabel
If you would like to show a custom message during submission, simply provide a loadingLabel prop. If this prop is provided, the loading prop of the button will then be applied internally.
<Formik>
<Form method="post">
...
<FormikSubmitButton loadingLabel="Submitting...">
Submit
</FormikSubmitButton>
</Form>
</Formik>Full API
Last updated on