BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/nexvyn/password-input

Password Input

nexvyn/password-input
FreeComponent

A password input with an animated eye toggle that follows your cursor and blinks periodically.

Live preview

live · rendered by the registry
Rendered by nexvyn on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://ui.nexvyn.dev/r/password-input.json

Source

components/ui/password-input.tsxui.nexvyn.dev/r/password-input.json · first 6 KB
1'use client'
2
3import { forwardRef, useEffect, useId, useRef, useState, type InputHTMLAttributes } from 'react'
4import { motion, useMotionValue, useReducedMotion, useSpring } from 'motion/react'
5import { cn } from '@/lib/utils'
6import { playHoverSound, playClickSound } from '@/lib/sound'
7
8const EYE_OPEN_TOP = 'M1 12 C1 12 5 4 12 4 C19 4 23 12 23 12'
9const EYE_CLOSED_TOP = 'M1 12 C1 12 5 12 12 12 C19 12 23 12 23 12'
10const EYE_OPEN_BOTTOM = 'M1 12 C1 12 5 20 12 20 C19 20 23 12 23 12'
11const EYE_CLOSED_BOTTOM = 'M1 12 C1 12 5 12 12 12 C19 12 23 12 23 12'
12const CLIP_OPEN = 'M1 12 C1 12 5 4 12 4 C19 4 23 12 23 12 C23 12 19 20 12 20 C5 20 1 12 1 12Z'
13const CLIP_CLOSED = 'M1 12 C1 12 5 12 12 12 C19 12 23 12 23 12 C23 12 19 12 12 12 C5 12 1 12 1 12Z'
14
15const PUPIL_RX = 5
16const PUPIL_RY = 3.5
17
18export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
19 label?: string
20 showLabel?: string
21 hideLabel?: string
22 containerClassName?: string
23 labelClassName?: string
24}
25
26export const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(
27 (
28 {
29 label = 'Password',
30 showLabel = 'Show password',
31 hideLabel = 'Hide password',
32 containerClassName,
33 labelClassName,
34 className,
35 id: idProp,
36 ...props
37 },
38 ref,
39 ) => {
40 const [visible, setVisible] = useState(false)
41 const [blinking, setBlinking] = useState(false)
42 const eyeRef = useRef<SVGSVGElement | null>(null)
43 const reactId = useId()
44 const id = idProp ?? reactId
45 const prefersReducedMotion = useReducedMotion()
46
47 const px = useMotionValue(0)
48 const py = useMotionValue(0)
49 const sx = useSpring(px, { stiffness: 350, damping: 28, mass: 0.4 })
50 const sy = useSpring(py, { stiffness: 350, damping: 28, mass: 0.4 })
51
52 useEffect(() => {
53 if (typeof window === 'undefined' || prefersReducedMotion) return
54 const handle = (e: MouseEvent) => {
55 const el = eyeRef.current
56 if (!el) return
57 const rect = el.getBoundingClientRect()
58 const cx = rect.left + rect.width / 2
59 const cy = rect.top + rect.height / 2
60 const dx = e.clientX - cx
61 const dy = e.clientY - cy
62 const dist = Math.hypot(dx, dy) || 1
63 const nx = dx / dist
64 const ny = dy / dist
65 const reach = Math.min(1, dist / 240)
66 px.set(nx * PUPIL_RX * reach)
67 py.set(ny * PUPIL_RY * reach)
68 }
69 window.addEventListener('mousemove', handle)
70// … truncated

What it pulls in

npm packages

  • motion

Files it writes

  • components/ui/password-input.tsx
  • lib/sound.ts

Facts

Registry
nexvyn
Type
registry:ui
Access
Free
Files written
2
Licence
MIT
First indexed
2026-08-01
Last confirmed
today

Go to the source

Docs on nexvyn ui.nexvyn.dev Nexvyn/Nexvyn-ui on GitHub Raw registry item This item as JSON

More from nexvyn

All 33 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
BadgebadgenexvynComponentsFree2 deps · 2 files
Bars Themebars-themenexvynComponentsFree1 dep · 3 files
Bounce Sidebarbounce-sidebarnexvynComponentsFree1 dep · 2 files
BreadcrumbsbreadcrumbsnexvynComponentsFree1 dep · 2 files
CheckboxcheckboxnexvynComponentsFree1 dep · 3 files
Clipboard Fieldclipboard-fieldnexvynComponentsFreeno deps · 2 files
Color Pickercolor-pickernexvynComponentsFreeno deps · 16 files
ComboboxcomboboxnexvynComponentsFree1 dep · 2 files
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex