newsbot-portal/components/bulma/button.templ

31 lines
744 B
Plaintext
Raw Normal View History

package bulma
// This creates a button that accepts children under it.
templ Button() {
<button type="button" class={ "button" }>
{ children... }
</button>
}
// Used to create a button and lets you define the color.
// Accepts children.
templ ButtonColor(color string) {
<button type="button" class={ "button", color }>
{ children... }
</button>
}
templ ButtonNewTab(url, text string) {
<button type="button" class="button">
<a href={ templ.SafeURL(url) } target="_blank" rel="noopener noreferrer">{ text }</a>
</button>
}
templ ALink(url, title string) {
<a href={ templ.SafeURL(url) }>{ title }</a>
}
templ ANewTab(url, text string) {
<a href={ templ.SafeURL(url) } target="_blank" rel="noopener noreferrer">{ text }</a>
}