- 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)
12 lines
257 B
Text
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>
|
|
}
|