UNPKG

@react-md/form

Version:

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

45 lines (44 loc) 1.46 kB
/// <reference types="react" /> import type { FieldMessageContainerExtension } from "../FormMessageContainer"; import type { PasswordProps } from "./Password"; /** * @remarks \@since 2.5.0 */ export declare type PasswordWithMessageProps = FieldMessageContainerExtension<PasswordProps>; /** * This component is a simple wrapper for the `Password` and `FormMessage` * components that should be used along with the `useTextField` hook to * conditionally show help and error messages with a `Password`. * * Simple example: * * ```ts * const [value, fieldProps] = useTextField({ * id: "field-id", * required: true, * minLength: 10, * }); * * return ( * <PasswordWithMessage * label="Label" * placeholder="Placeholder" * {...fieldProps} * /> * ); * ``` * * Note: Unlike the `TextFieldWithMessage` and `TextAreaWithMessage`, the error * icon will do nothing for this component unless the `disableVisibility` prop * is enabled. * * @remarks \@since 2.5.0 */ export declare const PasswordWithMessage: import("react").ForwardRefExoticComponent<PasswordProps & { 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>>;