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

Basic

Simplest show/hide usage with default icons and ARIA.

← All examples·basic

Preview

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

Details

  • inputProps and btnProps spread directly.
  • Default visibility is false; starts with input type=password.
  • Eye icons come from the package; no extra setup needed.

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

PreviousAllNextCustom icons

On this page

  • Preview
  • Details
Something wrong? Fix it