Repository navigation
Releases: wh1teee/mui-otp-input
Release list
@wh1teee/mui-otp-input 8.1.0
@wh1teee/mui-otp-input 8.1.0
This minor release fixes input-engine defects found in an independent review,
brings the MUI and Base UI renderers closer together, and replaces the
Docusaurus site with interactive documentation.
Input fixes
- MUI: a rejected character no longer erases the slot it was typed into;
the value is unchanged and onlyonInvalidfires. - Both renderers:
transformCharruns once per typed, pasted, or
autofilled character. Stored values (value,defaultValue) are validated
by position but no longer transformed again on every render. - Base UI:
validateCharreceives the real slot index for typed and pasted
characters, andonValueChangecan cancel a change withdetails.cancel(). - MUI: typing after the character of a filled slot overwrites only that
slot instead of replacing the rest of the code. - MUI: after
lengthshrinks, an uncontrolled field submits only the
visible characters. - Slots made read-only through
TextFieldsPropsorslotPropskeep their
characters on Backspace, Delete, and paste. - A form reset cancelled with
preventDefault()no longer clears the field. - MUI: arrow keys follow the visual order in right-to-left layouts.
One keyboard contract
- MUI now matches the Base UI field: Backspace deletes the slot's
character (or the previous one when the slot is empty) and steps back, and
only the active slot is in the tab order, so Tab moves past the whole code. - Both renderers keep IME composition text in the slot until composition ends
and commit it once. - Characters outside the Basic Multilingual Plane, such as emoji, are rejected
everywhere, so one slot always holds one character. - The MUI component still reports
onCompleteonce on mount for a value that
starts complete, as the original package did; the Base UI field reports
completion only for user input.
Forms and accessibility
- Base UI form adapter: React Hook Form marks the field touched only when
focus leaves the whole field, not when moving between slots. - MUI form adapter: the error message is referenced by every slot through
aria-describedby, not only the first. - Base UI: a slot's own
aria-describedbyis kept next to the field
description.
MUI presentation
- Six slots keep whole digits on phone widths: slots may shrink, side padding
is removed, and the default gap narrows from 20px with the field. TextFieldsProps.type(for example"password") is respected;maskstill
takes precedence.- A
gappassed toMuiOtpInputreplaces the default spacing in MUI 7 and 9. onInvalidis typed as the field callback rather than intersecting with the
DOMinvalidhandler.
Packaging and documentation
reactandreact-domare optional peers, so/headlessinstalls without
React; every UI entrypoint still requires them.- Documentation, a configurator with generated code, a React Hook Form example,
and a migration guide now live in the Next.js site undersite/. Its type
check, build, and Playwright/axe suite are part ofpnpm ci:pr.
Public exports and renderer boundaries are unchanged. The input fixes add
roughly 200–270 bytes gzip per renderer, so entrypoint budgets are re-based on
8.1.0 with about 5% headroom: MUI 4.7 KB, Base UI and shadcn 3.65 KB, MUI +
React Hook Form 5.15 KB gzip. /headless and Base UI + React Hook Form keep
their 8.0 ceilings.
@wh1teee/mui-otp-input 8.0.1
@wh1teee/mui-otp-input 8.0.1
This patch moves the repository, declaration checks, examples, and exact
consumer matrix to the stable native TypeScript 7 compiler. OTP runtime bytes,
public props, renderer boundaries, keyboard behavior, autofill handling, form
semantics, and CSS contracts are unchanged from 8.0.0.
TypeScript 7 toolchain
tscresolves to TypeScript7.0.2in the root package and docs workspace.- tsdown, Docusaurus, ESLint integrations, and any other tools that still embed
the compiler API receive Microsoft's official
@typescript/typescript6@6.0.2compatibility package through an npm alias. - The compatibility package is not used for project type-checking. A dedicated
executable contract proves the native TypeScript 7 binary, compatibility API,
docs compiler, and exact packed consumer topology. - Isolated React 18/19, MUI 7/9, Base UI, React Hook Form, Next.js 16 and SSR
consumers compile against the exact tarball using the same toolchain boundary.
This follows the TypeScript team's production guidance while TypeScript 7's
programmatic API remains unstable. It avoids holding the actual compiler on the
legacy JavaScript implementation solely for build tools that inspect TypeScript.
All existing unit, Chromium/Firefox/WebKit, automated WCAG, package boundary,
bundle budget, Next.js, docs/Storybook, OIDC provenance and registry byte-parity
gates remain mandatory.
@wh1teee/mui-otp-input 8.0.0
@wh1teee/mui-otp-input 8.0.0
This is the stable v8 release of the maintained fork. It synchronizes the MUI renderer with upstream v7, qualifies MUI 7/9 and React 18/19, and freezes renderer-independent OTP behavior for MUI and Base UI / shadcn applications.
Stable public surface
- Existing package-root imports remain MUI-compatible;
/muiis the explicit renderer alias. /base-uiand/shadcnexpose Base UI OTP primitives and a complete accessible field./headlessprovides normalization and completion utilities with no React or UI runtime.- Explicit React Hook Form adapters are published at
/mui/react-hook-form,/base-ui/react-hook-form, and/shadcn/react-hook-form; the historical/react-hook-formpath remains compatible. - The opt-in shadcn stylesheet is scoped to semantic
data-slotselectors and defines no reset, remote asset, or global token.
Behavior retained
Delayed autofocus, transformChar, paste preprocessing, native one-time-code replacement, stable refs, empty-slot focus routing, native form submission/reset, keyboard navigation, controlled/uncontrolled ownership, and opt-in auto-submit share one behavior contract across renderers.
Bundle and Next.js proof
Exact-tarball bundle budgets keep React and app-owned UI/form peers external. Current package-owned gzip closures are approximately 0.7 KiB headless, 2.9 KiB Base UI/shadcn, 3.8 KiB MUI, 3.1 KiB Base UI + RHF, and 4.0 KiB MUI + RHF. CI rejects cross-renderer imports and size regressions.
A production Next.js 16 App Router/Turbopack consumer installs the exact tarball, builds and server-renders the shadcn field without MUI/Emotion and without transpilePackages, serverExternalPackages, or experimental optimizePackageImports configuration.
Qualification
- 25 unit and adapter tests plus Chromium, Firefox, and WebKit typing, paste, autofill replacement, focus, form, narrow viewport, and automated WCAG checks.
- Strict declaration and SSR/runtime consumers from the exact tarball.
- MUI 7 + React 18 and MUI 9 + React 19 matrices.
- Base UI consumers without MUI/Emotion and MUI consumers without Base UI.
- Byte-identical npm registry artifact and provenance/signature verification through trusted OIDC publication.
Stable publication and npm latest promotion were explicitly authorized by the package owner on 2026-09-21.
@wh1teee/mui-otp-input 8.0.0-next.0
@wh1teee/mui-otp-input 8.0.0-next.0
This prerelease synchronizes the maintained fork with upstream v7 and introduces renderer-independent OTP behavior for MUI and Base UI / shadcn applications.
Included
- Existing root imports remain MUI-compatible;
/muiis the explicit alias. - Upstream MUI 9 support is included while MUI 7 + React 18 remains qualified.
/base-uiand/shadcnexpose Base UI OTP primitives and a complete accessible field./headlessprovides UI-independent normalization utilities.- MUI and Base UI React Hook Form adapters are published as separate subpaths.
- Fork behavior remains covered: delayed autofocus, character transformation, paste preprocessing, stable native refs, and empty-slot focus routing.
- The opt-in shadcn stylesheet is scoped to semantic
data-slotselectors and does not define global tokens or remote assets.
Qualification
- Chromium, Firefox, and WebKit input, paste, autofill replacement, keyboard, form, viewport, and automated WCAG checks.
- Strict declaration and SSR/runtime consumers from the exact tarball.
- MUI 7 + React 18 and MUI 9 + React 19 matrices.
- MUI consumers without Base UI installed and Base UI consumers without MUI/Emotion installed.
- Byte-identical registry artifact and npm provenance verification in the release workflow.
This is a prerelease published under the next dist-tag. It does not replace latest.