Number Input

Live Demos Hub
GitHub ↗

Number Input

Interactive production-grade hypermedia component for HTMXUI.

Interactive Preview

HTML Source

<!-- 
  Component: number-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 flex-col space-y-1.5">
  <label for="{id}" class="text-sm font-medium leading-none">{label}</label>
  <input type="number" id="{id}" name="{name}" min="{min}" max="{max}" step="{step}" value="{value}" class="flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50" hx-post="{update_url}" hx-trigger="change" />
</div>