@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.
25 lines (24 loc) • 1.11 kB
TypeScript
import * as React from 'react';
import { FieldRoot } from '../root/FieldRoot.js';
import { BaseUIComponentProps } from '../../utils/types.js';
/**
* The form control to label and validate.
* Renders an `<input>` element.
*
* You can omit this part and use any Base UI input component instead. For example,
* [Input](https://base-ui.com/react/components/input), [Checkbox](https://base-ui.com/react/components/checkbox),
* or [Select](https://base-ui.com/react/components/select), among others, will work with Field out of the box.
*
* Documentation: [Base UI Field](https://base-ui.com/react/components/field)
*/
declare const FieldControl: React.ForwardRefExoticComponent<FieldControl.Props & React.RefAttributes<HTMLInputElement>>;
declare namespace FieldControl {
type State = FieldRoot.State;
interface Props extends BaseUIComponentProps<'input', State> {
/**
* Callback fired when the `value` changes. Use when controlled.
*/
onValueChange?: (value: string | number | readonly string[] | undefined, event: Event) => void;
}
}
export { FieldControl };