ViraStack
  • About
  • Support
HomeGet StartedExamples
ViraStack

A DX-first toolkit for frontend developers: starters, agent rules, form hooks, and a guide.

Products

  • ViraStack Start
  • ViraStack AI
  • ViraStack Mask
  • ViraStack Password
  • ViraStack Guide

Explore

  • About
  • Brand
  • Support

© 2026 ViraStack.

Open source · MIT

Examples

  • All
  • Basic
  • Custom icons
  • Custom text
  • Disabled / readOnly
  • Programmatic
  • Prop merge

Disabled / readOnly

When disabled or readOnly, the toggle is locked and visibility cannot change.

← All examples·disabled

Preview

disabled: toggle locked

import { useViraPassword } from "@virastack/password"
 
function Example() {
  const { inputProps, btnProps } = useViraPassword({
    disabled: true,
    // or readOnly: true
  })
 
  return (
    <div className="relative">
      <input {...inputProps} placeholder="Your password" defaultValue="secret" />
      <button {...btnProps} />
    </div>
  )
}

Details

  • disabled: true → input and button disabled.
  • readOnly: true → input readOnly, button disabled.
  • toggle() and setVisible() become no-ops.

For the hook API see useViraPassword(), for styling and icons see customization.

PreviousCustom textNextProgrammatic

On this page

  • Preview
  • Details
Something wrong? Fix it