用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/lynx-family/lynx-ui --skill inputotp命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Provide the information about the `<LazyComponent>`. Show the common use cases, basic usage, and critical development Advises.
Use when building with lynx-ui: select components, verify public APIs, adapt examples, configure Luna themes, choose motion packages, compose screens, or troubleshoot lynx-ui usage.
基于 SOC 职业分类
正在显示 SKILL.md
| name | InputOTP |
| description | Build headless, configurable-length OTP, PIN, and verification-code inputs with lynx-ui InputOTP. |
InputOTP requires Lynx SDK 4.0 or newer.
InputOTP owns value and keyboard behavior through one hidden native input. Consumers compose the visible interface with InputOTPSlot. It supports:
ui-* state variants and render props without visible package CSS.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>
)
}
length; invalid values fall back to six slots.inputType="numeric", "alphabetic", or "alphanumeric" to choose
both the native keyboard and accepted ASCII characters.InputOTPRef.clear() to reset an uncontrolled field. In controlled
mode, update the value prop from onChange.onComplete as a readiness signal and keep network submission in the
parent.className and style for base slot styling. On the root, target
ui-focused, ui-complete, ui-disabled, and ui-invalid. On slots,
target ui-focused, ui-filled, ui-complete, ui-disabled, and
ui-invalid. Use the slot render function when custom character or caret
nodes need their own presentation.direction: rtl to the outer container and let descendants inherit it.<InputOTPSlot index={0}>
{({ filled }) =>
filled ? <text>•</text> : null}
</InputOTPSlot>
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.