@baseplate-dev/ui-components
Version:
Shared UI component library
36 lines • 1.31 kB
TypeScript
import type * as React from 'react';
import type { UseFormReturn } from 'react-hook-form';
interface FormActionBarProps extends React.ComponentProps<'div'> {
/**
* React Hook Form instance
*/
form?: UseFormReturn<any>;
/**
* Whether the form actions should be disabled (if undefined, will use (form.isSubmitting || !form.isDirty))
*/
disabled?: boolean;
/**
* Whether to enable the save button even if the form is not dirty (useful when submitting data where defaults are allowed)
*/
allowSaveWithoutDirty?: boolean;
/**
* Optional custom reset handler (defaults to form.reset)
*/
onReset?: () => void;
/**
* Children to render (custom action buttons)
*/
children?: React.ReactNode;
}
/**
* A fixed bottom bar with form action buttons (Reset and Save).
* Typically used at the bottom of forms to provide consistent action buttons.
*
* Can be used in two ways:
* 1. With a react-hook-form instance: `<FormActionBar form={form} />`
* 2. With individual props: `<FormActionBar disabled={isDisabled} onReset={handleReset} />`
*/
declare function FormActionBar(props: FormActionBarProps): React.ReactElement;
export { FormActionBar };
export type { FormActionBarProps };
//# sourceMappingURL=form-action-bar.d.ts.map