@yamada-ui/password-input
Version:
Yamada UI password input component
51 lines (48 loc) • 1.62 kB
text/typescript
import * as react from 'react';
import { HTMLUIProps, PropGetter } from '@yamada-ui/core';
import { FormControlOptions } from '@yamada-ui/form-control';
interface UsePasswordInputOptions {
/**
* Determines whether the password input is visible by default.
*
* @default false
*
* @deprecated Use `defaultVisible` instead.
*/
defaultIsVisible?: boolean;
/**
* Determines whether the password input is visible by default.
*
* @default false
*/
defaultVisible?: boolean;
/**
* Determines the visibility of the password input.
*
* @default false
*
* @deprecated Use `visible` instead.
*/
isVisible?: boolean;
/**
* Determines the visibility of the password input.
*
* @default false
*/
visible?: boolean;
/**
* Callback function that is triggered when the visibility of the password input changes.
*/
onVisibleChange?: (visible: boolean) => void;
}
interface UsePasswordInputProps extends Omit<HTMLUIProps<"input">, "disabled" | "readOnly" | "required" | "size">, FormControlOptions, UsePasswordInputOptions {
}
declare const usePasswordInput: (props: UsePasswordInputProps) => {
setVisible: react.Dispatch<react.SetStateAction<boolean>>;
visible: boolean;
getContainerProps: PropGetter<"div", undefined>;
getIconProps: PropGetter<"div", undefined>;
getInputProps: PropGetter<"input", undefined>;
};
type UsePasswordInputReturn = ReturnType<typeof usePasswordInput>;
export { type UsePasswordInputProps, type UsePasswordInputReturn, usePasswordInput };