Made of something. Used blackened steel around a recessed phosphor screen. Short scratches, edge wear and a small mechanical return key.

The moment. Submission scans while the caller validates. Accepted or denied replaces the displayed value; editing restores the original input. Stale requests are cancelled.

Yours to adapt. Copy the component source, styles and materials. Functional text stays live, effects respect reduced motion, and the artwork requires no remote hosting.

Try it

Enter a code and submit to try the demonstration validation.

Install

Add it with the shadcn CLI, or copy the source manually.

Release candidate: public installation becomes available after deployment. Use an existing React 19 project with shadcn initialized and a components.json file. The CLI installs the source, CSS, embedded materials, MIT licence and font notices together.

Terminal
npx shadcn@latest add https://seanportfol.io/r/grimkit-cipher-input.json
Prefer a namespace? Register the registry once.
Terminal
npx shadcn@latest registry add @seanlynch=https://seanportfol.io/r/{name}.json
Terminal
npx shadcn@latest add @seanlynch/grimkit-cipher-input

Usage

Copy this example into a separate file, not over the installed component. The @/ alias points to your source root. In Next.js this is a Client Component; Vite also accepts the directive. Replace demonstration actions with your application logic.

components/examples/cipher-input-demo.tsx
"use client";

import { CipherInput } from "@/components/grimkit/cipher-input";

export default function Example() {
  // Demonstration only. Real authorization must run on your server.
  return <CipherInput label="Access code" hint="Try VIGIL-7" onVerify={(value) => ({
    accepted: value.trim().toUpperCase() === "VIGIL-7",
    message: value.trim().toUpperCase() === "VIGIL-7" ? "Clearance accepted." : "Clearance denied.",
  })} />;
}

API Reference

Props on Cipher Input. Consult the included TypeScript source for supported native attributes.

PropTypeDefault
value / defaultValueControlled or initial input value.string
onValueChangeImmediate value changes while typing.(value: string) => void
onVerifyCaller-owned validation. Return { accepted: boolean, message: string }; honour cancellation.(value: string, signal: AbortSignal) => CipherResult | Promise<CipherResult>
label / hintVisible label and optional persistent guidance.string
disabled / readOnly / nameThe component owns its form; do not nest it inside another form.Native input attributes
classNameAdditional class on the control surface; does not replace the material styles.string
effectsAuto honours reduced motion; off disables decorative motion and particles."auto" | "off""auto"

Information

Category
GrimKit
Files
  • components/grimkit/cipher-input.tsx
  • components/grimkit/modern-cipher-input.tsx
  • components/grimkit/modern-foundation.css
  • components/grimkit/modern-cipher-input.css
  • components/grimkit/modern-cipher-input-materials.css
  • components/grimkit/modern-relay-display.css
  • components/grimkit/LICENSE.txt
  • components/grimkit/Saira-OFL.txt
  • components/grimkit/JetBrainsMono-OFL.txt
Dependencies
React 19 and React DOM 19; no additional runtime packages
Compatibility
React 19, TypeScript, CSS imports, Modern browsers
Version
0.2.0
Updated
Sep 22, 2026
Registry
grimkit-cipher-input