azabroflovski

Pin Input

Component

About

A multi-cell input for typing a short confirmation code or PIN one character per cell, with numeric or text mode, grouping, masking, paste-fill and arrow/backspace navigation.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Pin Input to your project and fits it to your theme.

Code

How Pin Input is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import * as React from "react";
import PinInput from "@/components/ui/pin-input";

export default function PinInputVariantsDemo() {
  const [invite, setInvite] = React.useState("");
  const [pin, setPin] = React.useState("");

  return (
    <div className="flex flex-col gap-4 rounded-lg bg-[#0b0b0f] p-8">
      <PinInput
        value={invite}
        onValueChange={setInvite}
        type="text"
        length={5}
        aria-label="Invite code"
      />
      <PinInput
        value={pin}
        onValueChange={setPin}
        length={4}
        mask
        aria-label="PIN"
      />
    </div>
  );
}

More by azabroflovski

View all
  • Switch

    Switch

    11
  • Select

    Select

    7
  • Dialog

    Dialog

    5
  • Checkbox

    Checkbox

    4
  • Hotkey Button

    Hotkey Button

  • Radio

    Radio

  • Card

    Card

  • Bar Chart

    Bar Chart