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