ViraStack
  • Academy
  • About
  • Support
HomeGet StartedExamples

Getting started

  • Introduction
  • Upgrade from 1.0
  • llms.txt
  • llms-full.txt

Usage

  • useViraPassword()
  • Strength
  • Confirm password
  • React Hook Form
  • Accessibility
  • Customization

Server

  • Server validation
  • Leaked passwords

Reference

  • Helpers
  • Types
  • UI libraries
  • Comparison

Upgrading from 1.0 to 1.1

1.1 adds features without breaking the hook. A few defaults changed; each can be turned off.

Summary

npm install @virastack/password@^1.1

The hook's options and return value are the same; new fields are additions. The 1.0 docs are archived.

New defaults

Behavior1.01.1 (how to turn off)
Form submit / resetVisibility unchangedHidden again (hideOnSubmit: false)
autoCompleteNot setcurrent-password; new-password with policy or matchWith (autoComplete: false)
spellCheck, autoCorrect, autoCapitalizeNot setOff (override in inputProps)
Toggle clicked with a mouseFocus stays on the buttonFocus and caret return to the input
mergeProps: aria-describedbyLater value winsValues are joined
mergeProps: refLater value winsRefs are composed
inputProps.idaria-controls kept the hook's idaria-controls follows inputProps.id
useViraPassword({
  hideOnSubmit: false, // keep the 1.0 behavior on submit
  autoComplete: false, // leave autocomplete out, as in 1.0
  inputProps: { spellCheck: true }, // your inputProps still win
})

New features

  • Options: visible, onVisibleChange, hideOnSubmit, hideOnBlur, autoComplete, policy, forbidden, matchWith, value
  • Return value: capsLock, strength, strengthProps, matches, issues, rule
  • Entries: /strength, /server, /pwned
  • composeRefs

Package

  • Files are .mjs / .cjs with .d.mts / .d.cts types. Deep imports into dist were never public; use the package entries.
  • getInputAriaAttributes returns a typed object instead of Record<string, any>.
  • Peer dependencies are unchanged: React and React DOM 18.2+.
PreviousIntroductionNextuseViraPassword()

On this page

  • Summary
  • New defaults
  • New features
  • Package
Something wrong? Fix it