xtablo-source/deprecated/internal/web/ui/button.templ
Arthur Belleville 5d0c201e86
Some checks failed
backend-ci / Backend tests (pull_request) Failing after 53s
backend-ci / Backend tests (push) Failing after 1s
Some work
2026-05-23 17:26:01 +02:00

22 lines
455 B
Text

package ui
type ButtonProps struct {
Label string
Variant ButtonVariant
Tone ButtonTone
Size Size
Type string
Icon string
Attrs templ.Attributes
}
templ Button(props ButtonProps) {
<button type={ buttonType(props.Type) } class={ buttonClass(props.Variant, props.Tone, props.Size) } { props.Attrs... }>
if props.Icon != "" {
<span class="ui-button-icon">
@UIIcon(props.Icon)
</span>
}
{ props.Label }
</button>
}