xtablo-source/backend/internal/web/ui/badge.templ
Arthur Belleville d056b33241 feat(01-02): add Button, Card, Badge templ components + CSS
- button.templ: Button(ButtonProps) renders <button type=...> with class
  from ui.ButtonClass(); Attrs spread for hx-* pass-through
- button.css: .ui-button base + .ui-button-solid-default-md variant
  with non-nested :hover and :focus-visible (Codex concern #7)
- card.templ: Card(attrs) accepts children via templ child syntax
- card.css: slate-50 panel, slate-200 border
- badge.templ: Badge(BadgeProps) renders <span class=...>
- badge.css: info / success / danger variants (warning deferred)
2026-05-14 18:46:42 +02:00

12 lines
257 B
Text

package ui
// BadgeProps is the input to the Badge templ component.
type BadgeProps struct {
Label string
Variant BadgeVariant
}
templ Badge(props BadgeProps) {
{{ class := BadgeClass(props.Variant) }}
<span class={ class }>{ props.Label }</span>
}