lotusui
A Go design system for desktop and mobile — one codebase, native apps. Web when you want it.
GitHub

InputOTP

The one-time-code input: attached character slots, one hidden editor.

Click anywhere on the row, type or paste — the code fills left to right, and the active slot carries the focus ring. One editor drives every slot, so paste and backspace behave exactly like a text field.

Installation

Use the module import (the default), or own the source: lotusui add vendors the component into your app and lotusui update keeps the copy mergeable — see Registry.

Go
go get github.com/ikaito-com/lotusui

# or vendor the source into your app:
go run github.com/ikaito-com/lotusui/cmd/lotusui add input-otp

Usage

open demo ↗

Separator

Groups splits the slots with a dash between groups.

open demo ↗

Length

open demo ↗

Pattern

Filter is the allow-list — digits only for numeric codes.

open demo ↗

Disabled

open demo ↗

Invalid

Invalid renders danger borders; pair it with a Field error.

open demo ↗

API

OptionTypeDescription
LengthintSlot count; zero means 6.
Groups[]intSlots per group, a dash between groups.
FilterstringAllow-list; empty accepts everything.
Disabled / InvalidboolDimmed and inert; danger borders.
Value() / SetValue(s)methodThe code typed so far.

lotusui is a Go design system for native desktop and mobile — and the web when you want it. Docs demos are the real components (WebAssembly) — one gallery app, each Preview an iframe addressed by URL hash.