Wrong Layout Input

Wrong Layout Input is a copy-paste React component that stops text typed in the wrong keyboard layout before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/wrong-layout-input
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsText typed in the wrong keyboard layout

Was this component page useful?

How do I install Wrong Layout Input?

pnpm dlx shadcn@latest add @bollard/wrong-layout-input

The files land in your project. They're yours to edit.

How do I use Wrong Layout Input in React?

wrong-layout-input-usage.tsx
import { WrongLayoutInput } from "@/components/ui/wrong-layout-input"

<WrongLayoutInput label="Reply to Olga" defaultValue="Ghbdtn? rfr ltkf&" />

What input mistakes does Wrong Layout Input catch?

  • Latin gibberish that is a word in another layout (ghbdtn → привет)
  • Non-Latin gibberish that is English in QWERTY (руддщ → hello)
  • Words no real language would spell
  • Names, acronyms, links, code and your ignore list, left alone

What props does Wrong Layout Input accept?

WrongLayoutInput props
PropTypeDefault
label

Visible label.

string"Message"
hint

Helper text shown while there is nothing to warn about.

string—
value

Controlled value.

string—
defaultValue

Initial value when uncontrolled.

string""
onValueChange

Called with the new value on every change, including a conversion and its undo.

(value: string) => void—
layouts

Layouts to check against US English QWERTY. Pass only the ones your users have to keep the bundle small.

KeyboardLayout[]KEYBOARD_LAYOUTS
ignore

Words that are never retyped: product names, codes, slang your users write.

string[]EMPTY
delay

Pause in ms before the warning appears while typing. Leaving the field shows it at once.

number600
latinName

Name of the Latin layout in messages.

string"English"
warning

Builds the warning. `typed` is the layout the text was typed in, `meant` the language it reads as.

(typed: string, meant: string) => string(typed, meant) => `Looks like ${meant} typed on the ${typ…
converted

Builds the note shown after converting, with a reminder that the keyboard is probably still wrong.

(meant: string, keyboard: string) => string(meant, keyboard) => `Retyped in ${meant}. Your keyboard …
useLabel

Start of the fix button's accessible name ("Use привет").

string"Use"
keepLabel

Accessible label of the button that keeps the text as typed.

string"Keep as typed"
undoLabel

Label of the button that restores the text as typed.

string"Undo"

* required. Also accepts the native props of <input> (className, aria-*, data-*…), passed through to it.

How is Wrong Layout Input accessible?

  • Visible <label>; hint via aria-describedby in a polite live region
  • Use button has an aria-label with the converted text; converted text gets a lang attribute
  • Keep and undo are labelled; focus returns to the input
  • Highlight animation respects reduced motion

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

  • Only the layouts you pass, each mapped against US QWERTY
  • Statistical: short words can be missed or wrongly flagged

What expensive mistakes does Wrong Layout Input stop?

Text typed in the wrong keyboard layout

Also known as

keyboard layout · wrong layout · transliteration · hindi inscript · russian · search box · punto switcher · language switch

Field type

What dependencies does Wrong Layout Input require?

Wrong Layout Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameWrong Layout Input
Registry identifier@bollard/wrong-layout-input
Install commandnpx shadcn@latest add @bollard/wrong-layout-input
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Wrong Layout Input

What form validation mistake does Wrong Layout Input catch?

Wrong Layout Input prevents text typed in the wrong keyboard layout. Notices text typed with the wrong keyboard layout ("ghbdtn" for "привет") and offers the retyped text as a one-tap fix. Catches: Latin gibberish that is a word in another layout (ghbdtn → привет), Non-Latin gibberish that is English in QWERTY (руддщ → hello), Words no real language would spell, Names, acronyms, links, code and your ignore list, left alone. Limitation: validate wrong-layout-input schemas on backend.

How do I install wrong-layout-input with shadcn?

Run `npx shadcn@latest add @bollard/wrong-layout-input`. Sources added: registry/default/wrong-layout-input/layouts.ts, registry/default/wrong-layout-input/wrong-layout-input.tsx. Package requirements: lucide-react.

What props customize Wrong Layout Input?

Wrong Layout Input accepts `label`, `hint`, `value`, `defaultValue`, `onValueChange`. Configures keyboard layout, wrong layout, transliteration behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of wrong-layout-input?

Only the layouts you pass, each mapped against US QWERTY. Statistical: short words can be missed or wrongly flagged Server requirement: backend verification for wrong-layout-input.

How does Wrong Layout Input meet accessibility guidelines?

Visible <label>; hint via aria-describedby in a polite live region. Use button has an aria-label with the converted text; converted text gets a lang attribute. Keep and undo are labelled; focus returns to the input. Highlight animation respects reduced motion. Minimizes errors: wrong keyboard layout typing, ghbdtn privet.

Which components pair with Wrong Layout Input?