GitHub ↗

Ribbon

Interactive production-grade hypermedia component for HTMXUI.

Interactive Preview

{text}

HTML Source

<!-- 
  Component: ribbon.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="absolute top-0 right-0 overflow-hidden w-24 h-24 pointer-events-none">
  <div class="absolute top-0 right-0 transform translate-x-[25%] -translate-y-[25%] rotate-45 bg-primary text-primary-foreground text-xs font-bold px-8 py-1 shadow-md">
    {text}
  </div>
</div>