GitHub ↗

Slider

Interactive production-grade hypermedia component for HTMXUI.

Interactive Preview

{value}

HTML Source

<!-- 
  Component: slider.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 w-full items-center space-x-4">
  <input type="range" name="{name}" min="{min}" max="{max}" step="{step}" value="{value}" class="w-full h-2 bg-secondary rounded-lg appearance-none cursor-pointer accent-primary" hx-post="{update_url}" hx-trigger="change" />
  <span class="text-sm font-medium text-foreground w-8 text-right">{value}</span>
</div>