Password input

A password field with a key to show or hide it.

Component

Password input belongs to the Fields group in the CyberSpec catalog. It uses @ui-sdk/react/password-input, @ui-sdk/react/field.

Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/password-input.json

Example

"use client"

import { PasswordInput } from "@/components/ui/password-input"

export default function PasswordInputDemo() {
  return (
    <>
      <PasswordInput label="Passphrase" defaultValue="lowtide-0417-ghost" hint="Unlocks the deck. Never leaves it." autoComplete="off" required />
      <PasswordInput
        label="Relay key"
        defaultValue="7Hq2-vX9p"
        defaultVisible
        error="Key rejected by the Glasswater relay."
        autoComplete="off"
      />
      <PasswordInput label="Vault phrase" defaultValue="sealed" autoComplete="off" disabled />
    </>
  )
}

Install this example

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/password-input-demo.json

Resources

View as Markdown