# Password

> A super simple password input component with a toggle options that hides or reveals your password.

A shadcn/ui block from the [@nordaun](https://ui.nordaun.com) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/nordaun/password).

- Page, with a live preview: https://shadcn.exchange/r/nordaun/password
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/nordaun/password-light-b1a8215cf303c8e8.png
- Registry item: https://ui.nordaun.com/r/password.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.nordaun.com/r/password.json
```

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

## Dependencies

- npm packages: `lucide-react`
- Registry items: `button`, `input-group`

## Files

### `src/components/ui/password.tsx`

```tsx
"use client";

import * as React from "react";

import { Button } from "@/components/ui/button";
import {
  InputGroup,
  InputGroupAddon,
  InputGroupInput,
} from "@/components/ui/input-group";
import { Eye, EyeClosed } from "lucide-react";

function Password({ className, ...props }: React.ComponentProps<"input">) {
  const [visible, setVisible] = React.useState<boolean>(false);

  return (
    <InputGroup>
      <InputGroupInput
        type={visible ? "text" : "password"}
        {...props}
        className={className}
      />
      <InputGroupAddon align={"inline-end"}>
        <Button
          variant={"link"}
          type="button"
          onClick={() => setVisible(!visible)}
        >
          {visible ? <Eye /> : <EyeClosed />}
        </Button>
      </InputGroupAddon>
    </InputGroup>
  );
}

export { Password };
```
