# Password input with visibility toggle

> Password input with visibility toggle

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-input-group-35).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-input-group-35
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-input-group-35-light-09ee6f153a7c5f9a.png
- Registry item: https://reui.io/r/new-york-v4/c-input-group-35.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-input-group-35.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `field`, `input-group`

## Files

### `c-input-group-35.tsx`

```tsx
"use client"

import { useState } from "react"

import { Field } from "@/components/ui/field"
import {
  InputGroup,
  InputGroupAddon,
  InputGroupButton,
  InputGroupInput,
} from "@/components/ui/input-group"
import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"

export function Pattern() {
  const [showPassword, setShowPassword] = useState(false)

  return (
    <Field className="max-w-xs">
      <InputGroup>
        <InputGroupAddon>
          <IconPlaceholder
            lucide="LockIcon"
            tabler="IconLock"
            hugeicons="SquareLock01Icon"
            phosphor="LockSimpleIcon"
            remixicon="RiLockLine"
            className="text-muted-foreground size-4"
          />
        </InputGroupAddon>
        <InputGroupInput
          type={showPassword ? "text" : "password"}
          placeholder="Enter password"
        />
        <InputGroupButton
          variant="ghost"
          onClick={() => setShowPassword(!showPassword)}
        >
          {showPassword ? (
            <IconPlaceholder
              lucide="EyeOffIcon"
              tabler="IconEyeOff"
              hugeicons="ViewOffSlashIcon"
              phosphor="EyeSlashIcon"
              remixicon="RiEyeOffLine"
              className="text-muted-foreground size-4"
            />
          ) : (
            <IconPlaceholder
              lucide="EyeIcon"
              tabler="IconEye"
              hugeicons="ViewIcon"
              phosphor="EyeIcon"
              remixicon="RiEyeLine"
              className="text-muted-foreground size-4"
            />
          )}
        </InputGroupButton>
      </InputGroup>
    </Field>
  )
}
```
