NeonKit
esc
  • IntroductionGetting started
  • InstallationGetting started
  • ThemingGetting started
  • Use with AIGetting started
  • All componentsGetting started
  • ButtonSolid, outline, soft, ghost and link buttons that light up on hover.Forms
  • InputText field with an animated neon focus ring, icons, labels and error states.Forms
  • TextareaMulti-line field that grows with its content and counts characters.Forms
  • SelectKeyboard-friendly listbox with a glowing popover and typeahead.Forms
  • CheckboxCheckbox with a drawn-on checkmark and indeterminate state.Forms
  • Radio GroupSingle choice from a set, with arrow-key navigation and card layouts.Forms
  • SwitchA toggle that powers on like a neon tube.Forms
  • SliderPointer and keyboard slider with a glowing track and optional range.Forms
  • OTP InputOne-time code input with auto-advance, paste and backspace handling.Forms
  • BadgeStatus labels with optional live dot and remove button.Data Display
  • AvatarProfile image with initials fallback, status light and stacked groups.Data Display
  • CardSurface with header, content and footer slots and a lit edge.Data Display
  • KbdKeyboard keys and shortcuts that glow when pressed.Data Display
  • TabsTabbed panels with a sliding light indicator and roving focus.Data Display
  • AccordionCollapsible sections with smooth height animation.Data Display
  • ProgressLinear and circular progress with a moving highlight.Feedback
  • SpinnerRing, dots and bars loaders in any neon color.Feedback
  • SkeletonLoading placeholders with a scanning shimmer.Feedback
  • AlertInline messages for info, success, warning and errors.Feedback
  • ToastStacked notifications with a tiny toast() API. No provider needed.Feedback
  • DialogAccessible modal built on the native dialog element.Overlay
  • TooltipHover and focus hints on four sides.Overlay
  • Neon TextText rendered as a glowing tube sign, with optional power-on flicker.Effects
  • Border BeamA beam of light that travels around any element's border.Effects
  • Spotlight CardCard whose border and surface light up under the cursor.Effects
  • Retro GridSynthwave perspective grid that scrolls toward the horizon.Effects

Components/Forms

OTP Input

One-time code input with auto-advance, paste and backspace handling.

Check your inbox

Enter the 6-digit code we sent to ada@northwind.io

Didn't get it?

Installation#

npx shadcn@latest add https://get-neonkit.vercel.app/r/otp-input.json

Usage#

import { OTPInput } from "@/components/ui/otp-input"

<OTPInput onComplete={(code) => verify(code)} />

Examples#

Grouped

groupSize splits the slots with a dash, so long codes are easier to read back.

Pair your TV

Type the code shown on the screen.

Masked PIN

mask shows dots instead of digits.

Approve production deploy

Enter your 4-digit PIN to ship v2.4.0.

Invalid code

The row shakes and turns red each time invalid switches on.

Two-factor authentication

Open your authenticator app. Anything but 424242 fails.

Letters and numbers

mode="alphanumeric" accepts letters too and brings up the full keyboard on phones.

Use a recovery code

One of the 8-character codes you saved when you set up 2FA.

API reference#

OTPInput

Other props and the ref go to the wrapping group element.

PropTypeDefault
lengthnumber

Number of slots.

6
valuestring

Controlled code.

—
defaultValuestring

Initial code when uncontrolled.

—
onValueChange(code: string) => void

Called on every change.

—
onComplete(code: string) => void

Called when the last empty slot is filled.

—
mode"numeric" | "alphanumeric"

Characters accepted. Also picks the mobile keyboard.

"numeric"
groupSizenumber

Puts a dash after every groupSize slots.

—
maskboolean

Shows dots instead of characters.

false
invalidboolean

Red state. Shakes the row when it switches on.

false
disabledboolean

Disables every slot.

false
autoFocusboolean

Focuses the first empty slot on mount.

false
namestring

Submits the code with a surrounding form.

—
aria-labelstring

Names the group of slots.

"One-time code"
colorNeonColor

Palette name or hex. Falls back to --neon-accent, then cyan.

inherited
size"sm" | "md" | "lg"

Slot size and text size.

"md"

Accessibility#

  • Each slot is a native input labelled "Digit 2 of 6" inside a named group.
  • The first slot uses autocomplete="one-time-code", so codes from SMS can fill every slot in one tap.
  • Pasting fills from the focused slot. A full-length code always fills from the start, and spaces or dashes are dropped.
  • Only the next slot to fill is in the tab order. Arrow keys, Home and End move between slots.
  • Backspace clears the focused slot, or steps back and clears the previous one when the focused slot is empty.
  • Link an error message with aria-describedby when invalid is on. The shake is skipped when reduced motion is on.