Documentation
¶
Overview ¶
templ: version: v0.2.793
templ: version: v0.2.793
Index ¶
Constants ¶
View Source
const ( Primary Variant = "primary" Secondary Variant = "secondary" Text Variant = "text" Delete Variant = "delete" Error Variant = "error" Warning Variant = "warning" Success Variant = "success" Info Variant = "info" Icon Variant = "icon" Gray Variant = "gray" Md Size = "md" Sm Size = "sm" Lg Size = "lg" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Props ¶
type Props struct {
// Variant determines the visual style of the button.
Variant Variant `default:"primary"`
// Label is the content of the button.
// Default: "" (empty string)
Label string
// Size sets the size of the button.
Size Size `default:"md"`
// FullWidth determines whether the button should take up the full width of its container.
// Default: false
FullWidth bool
// Click is the JavaScript function to be called when the button is clicked. Usuallu by AlpineJS
// Default: ""
Click string
// Prevent is a bool to indicate whether the default action should occur onClick
// Default: false
Prevent bool
// HX allows passing additional HTMX attributes to the button or anchor element.
// Default: nil
HX htmx.Props
// Disabled can be either a bool or a string.
// If bool (Go), it directly controls the disabled state.
// If string, it's treated as a JavaScript expression for dynamic disabling.
Disabled bool
// IconLeft specifies an icon component to be displayed on the left side of the button text.
// Use IconLeft with a label for an Icon button
// Default: nil
IconLeft templ.Component
// IconRight specifies an icon component to be displayed on the right side of the button text.
// Default: nil
IconRight templ.Component
// Content - for truly dynamic button content
// Default: nil
Content templ.Component
// Class specifies additional CSS classes to apply to the button to override any previous class.
// Default: "" (empty string)
Class string
// Attrs allows passing additional HTML attributes to the button or anchor element.
// Default: nil
Attrs templ.Attributes
}
Click to show internal directories.
Click to hide internal directories.