GitHub ↗

Chip

Interactive production-grade hypermedia component for HTMXUI.

Interactive Preview

{text}

HTML Source

<!-- 
  Component: chip.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="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium bg-muted text-foreground border border-border">
  {text}
  <button hx-delete="{delete_url}" hx-target="closest div" hx-swap="outerHTML" class="ml-2 hover:text-destructive">✕</button>
</div>