InputOTP
БесплатноЗапускает вложенные скриптыНе проверенBuild headless, configurable-length OTP, PIN, and verification-code inputs with lynx-ui InputOTP.
от lynx-family★ 122 звезды на GitHubОб этом скилле
lynx-ui InputOTP
Requirements
InputOTP requires Lynx SDK 4.0 or newer.
Core capabilities
InputOTP owns value and keyboard behavior through one hidden native input. Consumers compose the visible interface with InputOTPSlot. It supports:
- A configurable positive number of numeric, alphabetic, or alphanumeric ASCII characters.
- Controlled and uncontrolled values.
- Completion, focus, and blur callbacks.
- Imperative focus, blur, set, clear, and read methods.
- Consumer-defined slot layout, separators, masking, caret, themes, and RTL.
- Typed
ui-*state variants and render props without visible package CSS.
Minimal example
import { useState } from '@lynx-js/react'
import { InputOTP, InputOTPSlot } from '@lynx-js/lynx-ui'
function VerificationCode() {
const [code, setCode] = useState('')
return (
<InputOTP
autoFocus
length={6}
value={code}
onChange={setCode}
onComplete={(completeCode) => {
console.log('verify', completeCode)
}}
>
{Array.from(
{ length: 6 },
(_, index) => (
<InputOTPSlot
key={index}
index={index}
className='otp-slot'
/>
),
)}
</InputOTP>
)
}
Usage guidance
- Render one InputOTPSlot for every configured index.
- Pass a positive integer to
length; invalid values fall back to six slots. - Use
inputType="numeric","alphabetic", or"alphanumeric"to choose both the native keyboard and accepted ASCII characters. - Prefer controlled mode when a parent submits, validates, or resets the value.
- Use
InputOTPRef.clear()to reset an uncontrolled field. In controlled mode, update the value prop fromonChange. - Treat
onCompleteas a readiness signal and keep network submission in the parent. - Implement masking with the InputOTPSlot render function. The original value remains available to InputOTP callbacks.
- Insert separator nodes directly between InputOTPSlot children.
- Use
classNameandstylefor base slot styling. On the root, targetui-focused,ui-complete,ui-disabled, andui-invalid. On slots, targetui-focused,ui-filled,ui-complete,ui-disabled, andui-invalid. Use the slot render function when custom character or caret nodes need their own presentation. - Apply
direction: rtlto the outer container and let descendants inherit it.
Masked slot example
<InputOTPSlot index={0}>
{({ filled }) =>
filled ? <text>•</text> : null}
</InputOTPSlot>
Component roles
InputOTP: owns the native input, normalized value, callbacks, and context.InputOTPSlot: consumes a zero-based character index and renders either the default character/caret nodes or custom render-prop content.
Установить InputOTP в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл InputOTP?
Build headless, configurable-length OTP, PIN, and verification-code inputs with lynx-ui InputOTP.
Как установить скилл InputOTP?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл InputOTP запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic