@base-ui-components/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
27 lines (26 loc) • 946 B
TypeScript
import * as React from 'react';
import type { BaseUIComponentProps } from '../utils/types.js';
import { FormContext } from './FormContext.js';
/**
* A native form element with consolidated error handling.
* Renders a `<form>` element.
*
* Documentation: [Base UI Form](https://base-ui.com/react/components/form)
*/
declare const Form: React.ForwardRefExoticComponent<Form.Props & React.RefAttributes<HTMLFormElement>>;
declare namespace Form {
interface Props extends BaseUIComponentProps<'form', State> {
/**
* An object where the keys correspond to the `name` attribute of the form fields,
* and the values correspond to the erorr(s) related to that field.
*/
errors?: FormContext['errors'];
/**
* Event handler called when the `errors` object is cleared.
*/
onClearErrors?: FormContext['onClearErrors'];
}
interface State {
}
}
export { Form };