UNPKG

@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.

26 lines (25 loc) 992 B
import * as React from 'react'; import { FieldRoot } from '../root/FieldRoot.js'; import type { BaseUIComponentProps } from '../../utils/types.js'; /** * An error message displayed if the field control fails validation. * Renders a `<div>` element. * * Documentation: [Base UI Field](https://base-ui.com/react/components/field) */ declare const FieldError: React.ForwardRefExoticComponent<FieldError.Props & React.RefAttributes<HTMLDivElement>>; declare namespace FieldError { type State = FieldRoot.State; interface Props extends BaseUIComponentProps<'div', State> { /** * Determines whether to show the error message according to the field’s * [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState). */ match?: keyof ValidityState; /** * Whether the error message should be shown regardless of the field’s validity. */ forceShow?: boolean; } } export { FieldError };