Helpers
mergeProps, composeRefs, core helpers and the default icons.
Core helpers
import { getButtonAriaAttributes, getInputAriaAttributes, getInputType } from "@virastack/password"
getInputType(true) // "text"
getButtonAriaAttributes(false, "password", "Show password")
// { "aria-label": "Show password", "aria-pressed": false, "aria-controls": "password", type: "button" }
getInputAriaAttributes(true, "password-hint") // { "aria-invalid": true, "aria-describedby": "password-hint" }Icons
import { EyeIcon, EyeOffIcon } from "@virastack/password"
<EyeIcon width={20} className="text-muted-foreground" />mergeProps
import { mergeProps } from "@virastack/password"
<input {...mergeProps(inputProps, form.register("password", rule))} />
// on* handlers: both run, the first argument first
// className, aria-describedby: joined
// ref: composed
// anything else: the later value winscomposeRefs
import { composeRefs } from "@virastack/password"
<input ref={composeRefs(localRef, field.ref)} />
// supports object refs, callback refs and React 19 ref cleanups