Pin Input

Live Demos Hub
GitHub ↗

Pin Input

Interactive production-grade hypermedia component for HTMXUI.

Interactive Preview

-

HTML Source

<!-- 
  Component: pin-input.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 items-center gap-2" id="{id}">
  <input type="text" maxlength="1" class="w-10 h-12 text-center text-lg font-semibold border border-input bg-background rounded-md shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" />
  <input type="text" maxlength="1" class="w-10 h-12 text-center text-lg font-semibold border border-input bg-background rounded-md shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" />
  <input type="text" maxlength="1" class="w-10 h-12 text-center text-lg font-semibold border border-input bg-background rounded-md shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" />
  <span class="text-muted-foreground">-</span>
  <input type="text" maxlength="1" class="w-10 h-12 text-center text-lg font-semibold border border-input bg-background rounded-md shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" />
  <input type="text" maxlength="1" class="w-10 h-12 text-center text-lg font-semibold border border-input bg-background rounded-md shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" />
  <input type="text" maxlength="1" class="w-10 h-12 text-center text-lg font-semibold border border-input bg-background rounded-md shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" />
</div>