Input Otp
Live Demos HubInput Otp
Interactive production-grade hypermedia component for HTMXUI.
Interactive Preview
HTML Source
<!--
Component: input-otp.html
Configurable State: themeColor ('primary'|'secondary'|'destructive'), size ('sm'|'md'|'lg'), isOpen (boolean)
Usage: Bind styles dynamically using hx-class="{ 'bg-primary': themeColor === 'primary' }" or hx-style="{ width: size === 'lg' ? '100%' : 'auto' }"
-->
<div hx-ext="reactive" hx-state="{ themeColor: \'primary\', size: \'md\', isOpen: false }" class="flex gap-2 justify-center" id="{id}">
<!-- Typical implementation uses a hidden actual input and visual boxes -->
<input type="text" maxlength="1" class="w-10 h-12 text-center text-lg border border-input rounded-md focus:ring-2 focus:ring-ring" />
<input type="text" maxlength="1" class="w-10 h-12 text-center text-lg border border-input rounded-md focus:ring-2 focus:ring-ring" />
<input type="text" maxlength="1" class="w-10 h-12 text-center text-lg border border-input rounded-md focus:ring-2 focus:ring-ring" />
<input type="text" maxlength="1" class="w-10 h-12 text-center text-lg border border-input rounded-md focus:ring-2 focus:ring-ring" />
</div>