UNPKG

@react-md/form

Version:

This package is for creating all the different form input types.

39 lines (38 loc) 1.25 kB
/// <reference types="react" /> import type { FieldMessageContainerExtension } from "../FormMessageContainer"; import type { TextFieldProps } from "./TextField"; /** * @remarks \@since 2.5.0 */ export declare type TextFieldWithMessageProps = FieldMessageContainerExtension<TextFieldProps>; /** * This component is a simple wrapper for the `TextField` and `FormMessage` * components that should be used along with the `useTextField` hook to * conditionally show help and error messages with a `TextField`. * * Simple example: * * ```ts * const [value, fieldProps] = useTextField({ * id: "field-id", * }); * * return ( * <TextFieldWithMessage * label="Label" * placeholder="Placeholder" * {...fieldProps} * /> * ); * ``` * * @remarks \@since 2.5.0 */ export declare const TextFieldWithMessage: import("react").ForwardRefExoticComponent<TextFieldProps & { messageProps?: (import("..").FormMessageProps & { ref?: import("react").Ref<HTMLDivElement> | undefined; }) | undefined; messageContainerProps?: (import("react").HTMLAttributes<HTMLDivElement> & { ref?: import("react").Ref<HTMLDivElement> | undefined; }) | undefined; } & import("react").RefAttributes<HTMLInputElement>>;