Documentation ¶
Overview ¶
templ: version: v0.2.793
templ: version: v0.2.793
templ: version: v0.2.793
templ: version: v0.2.793
templ: version: v0.2.793
templ: version: v0.2.793
templ: version: v0.2.793
templ: version: v0.2.793
templ: version: v0.2.793
Index ¶
- Constants
- func BreadcrumbActive(url, text string) templ.Component
- func BreadcrumbActiveIcon(url, text, faIcon string) templ.Component
- func BreadcrumbPrevious(url, text string) templ.Component
- func BreadcrumbPreviousIcon(url, text, faIcon string) templ.Component
- func ButtonLink(url, text, color, size string) templ.Component
- func ButtonNewTab(url, text, color, size string) templ.Component
- func CardFooterItem(url, text string) templ.Component
- func CardHeaderIcon(title string) templ.Component
- func CardImage(imageSize, src, alt string) templ.Component
- func Delete(size string) templ.Component
- func DropdownMenuLink(url, text string) templ.Component
- func DropdownMenuSeperator() templ.Component
- func DropdownTrigger(text, controls string) templ.Component
- func ExampleBreadcrumb() templ.Component
- func ExampleCard() templ.Component
- func ExampleDropdown() templ.Component
- func ExampleMenu() templ.Component
- func FormCheckbox(text, id string) templ.Component
- func FormLabel(text string) templ.Component
- func FormLabelSelectOne(label, id string) templ.Component
- func FormLabelTextInput(id, label, placeholder string) templ.Component
- func FormSelectManyItem(name string) templ.Component
- func FormSelectOneColor(color, id string, isRound bool) templ.Component
- func FormSelectOneItem(name string) templ.Component
- func FormSubmit(text, color string) templ.Component
- func FormTextArea(id, placeholder, color string) templ.Component
- func FormTextInput(id, fieldType, placeholder, color string) templ.Component
- func FormTextInputWithValue(id, fieldType, value, color string, readonly bool) templ.Component
- func H1(message string, isSubtitle bool) templ.Component
- func H2(message string, isSubtitle bool) templ.Component
- func H3(message string, isSubtitle bool) templ.Component
- func H4(message string, isSubtitle bool) templ.Component
- func H5(message string, isSubtitle bool) templ.Component
- func Hero(title, subtitle, size, color string) templ.Component
- func HxButtonLink(color, size, text string, hx HtmxProperties) templ.Component
- func HxDropdownMenuLink(text string, hx HtmxProperties) templ.Component
- func HxLink(text string, hx HtmxProperties) templ.Component
- func HxNavbarItem(text string, hx HtmxProperties) templ.Component
- func HxTabLink(text string, isActive bool, hx HtmxProperties) templ.Component
- func HxTabLinkIcon(text, fontAwesomeIcon string, isActive bool, hx HtmxProperties) templ.Component
- func Icon(fontAwesomeIcon string) templ.Component
- func IconText(fontAwesomeIcon, text string) templ.Component
- func ImageSrc(image, src, alt string) templ.Component
- func MediaImage(image, url string, isLeft, isRight bool) templ.Component
- func MenuLabel(text string) templ.Component
- func MenuListItem(url, title string) templ.Component
- func MessageWithHeader(text string) templ.Component
- func NavbarBrandBurger(dataTarget string) templ.Component
- func NavbarExample() templ.Component
- func NavbarItem(url, text string) templ.Component
- func NavbarItemChildren(url string) templ.Component
- func NavbarItemDropdownDivider() templ.Component
- func NewBlock() templ.Component
- func NewBox() templ.Component
- func NewBreadcrumb(alignment, separator, size string) templ.Component
- func NewButton(color, size string) templ.Component
- func NewCard() templ.Component
- func NewCardContent() templ.Component
- func NewCardFooter() templ.Component
- func NewCardHeader(title string) templ.Component
- func NewColumn(columnSize ...string) templ.Component
- func NewColumns(columns ...string) templ.Component
- func NewContainer(breakpoint string) templ.Component
- func NewContent() templ.Component
- func NewDropdown() templ.Component
- func NewDropdownMenu(controls string) templ.Component
- func NewFlexGrid(useAutoCount bool) templ.Component
- func NewForm(url string) templ.Component
- func NewFormControl() templ.Component
- func NewFormField() templ.Component
- func NewFormSelectMany(howManySelectable int, id string, isRound bool) templ.Component
- func NewFormSelectManyColor(howManySelectable int, color, id string, isRound bool) templ.Component
- func NewFormSelectOne(id string, isRound bool) templ.Component
- func NewGrid() templ.Component
- func NewGridCell() templ.Component
- func NewHxContainer(breakpoint, id string, hx HtmxProperties) templ.Component
- func NewHxForm(hxpostUrl string) templ.Component
- func NewHxTableBody(hx HtmxProperties) templ.Component
- func NewImage(image string) templ.Component
- func NewLevel(isMobile bool) templ.Component
- func NewLevelItem(hasTextCentered bool) templ.Component
- func NewLevelLeft() templ.Component
- func NewLevelRight() templ.Component
- func NewMedia() templ.Component
- func NewMediaContent() templ.Component
- func NewMediaLeft() templ.Component
- func NewMediaRight() templ.Component
- func NewMenu() templ.Component
- func NewMenuList() templ.Component
- func NewMessage(size, color string) templ.Component
- func NewMessageBody() templ.Component
- func NewModel() templ.Component
- func NewModelContent() templ.Component
- func NewNavbar() templ.Component
- func NewNavbarBrand() templ.Component
- func NewNavbarEnd() templ.Component
- func NewNavbarItemDropdown(text string) templ.Component
- func NewNavbarMenu(dataTarget string) templ.Component
- func NewNavbarStart() templ.Component
- func NewPagination() templ.Component
- func NewPaginationList() templ.Component
- func NewPanel(color string) templ.Component
- func NewPanelTabs() templ.Component
- func NewSection(size string) templ.Component
- func NewTab(alignment, size, style string, isFullWidth bool) templ.Component
- func NewTable(table ...string) templ.Component
- func NewTableDataChildren() templ.Component
- func NewTableHeader() templ.Component
- func NewTableRow() templ.Component
- func Notification(message, color string) templ.Component
- func PaginationActive(text, ariaLabel string) templ.Component
- func PaginationEllispsis() templ.Component
- func PaginationExample() templ.Component
- func PaginationListItem(url, text, ariaLabel string) templ.Component
- func PaginationNext(url, text string) templ.Component
- func PaginationPrevious(url, text string) templ.Component
- func PanelBlock(url, text, faIcon string, isActive bool) templ.Component
- func PanelHeader(text string) templ.Component
- func PanelHeaderIcon(text, faIcon string) templ.Component
- func PanelTabItem(url, text string) templ.Component
- func PanelTabItemActive(url, text string) templ.Component
- func ProgressBar(color string, value, max int) templ.Component
- func RequiredModelScript() templ.Component
- func RequiredNavbarToggleScript() templ.Component
- func Subitle(message string) templ.Component
- func TabLink(url, text, fontAwesomeIcon string, isActive bool) templ.Component
- func TabLinkIcon(url, text, fontAwesomeIcon string, isActive bool) templ.Component
- func TableData(value string) templ.Component
- func TableHeaderData(value string) templ.Component
- func TableHeaderDataToolTip(value, tooltip string) templ.Component
- func TableHeaderValues(values ...string) templ.Component
- func Tag(message, color, size string) templ.Component
- func Title(message string) templ.Component
- func UseBulmaCdn() templ.Component
- func UseThemeCatppuccinMocha() templ.Component
- type HtmxProperties
Constants ¶
const ( InputTypeText = "text" InputTypePassword = "password" InputTypeEmail = "email" InputTypePhoneNumber = "tel" )
const ( HxTriggerClick = "clicked" HxTriggerMouseEnter = "mouseenter" HxSwapInnerHtml = "innerHtml" HxSwapOuterHtml = "outerHtml" HxSwapDefault = HxSwapInnerHtml HxSwapBlank = "" )
const ( AlignmentLeft = "" AlignmentCentered = "is-centered" AlignmentRight = "is-right" BreakpointDefault = "" BreakpointWidescreen = "is-widescreen" BreakpointFullHd = "is-fullhd" BreakpointMaxDesktop = "is-max-desktop" BreakpointMaxWidescreen = "is-max-widescreen" ColorDefault = "" ColorPrimary = "is-primary" ColorInfo = "is-info" ColorLink = "is-link" ColorWarning = "is-warning" ColorSuccess = "is-success" ColorDanger = "is-danger" ColumnsVCentered = "is-vcentered" ColumnsMultiline = "is-multiline" ColumnsMobile = "is-mobile" ColumnsCentered = "is-centered" ColumnsNarrow = "is-narrow" ColumnsGapless = "is-gapless" ColumnSizeDefault = "" ColumnSizeIsThreeQuarters = "is-three-quarters" ColumnSizeIsTwoThirds = "is-two-thirds" ColumnSizeIsHalf = "is-half" ColumnSizeIsOneThird = "is-one-third" ColumnSizeIsOneQuarter = "is-one-quarter" ColumnSizeIsFull = "is-full" ColumnOffsetDefault = "" ColumnOffsetOneQuarter = "is-offset-one-quarter" ColumnOffsetOneFifth = "is-offset-one-fifth" ImageIs16x16 = "is-16x16" ImageIs24x24 = "is-24x24" ImageIs32x32 = "is-32x32" ImageIs64x64 = "is-64x64" ImageIs96x96 = "is-96x96" ImageIs128x128 = "is-128x128" ImageIs4by3 = "is-4by3" SeparatorDefault = "" SeparatorArrow = "has-arrow-separator" SeparatorBullet = "has-bullet-separator" SeparatorDot = "has-dot-separator" SeparatorSucceeds = "has-succeeds-separator" SizeDefault = "" SizeSmall = "is-small" SizeNormal = "is-normal" SizeMedium = "is-medium" SizeLarge = "is-large" StyleDefault = "" StyleBoxed = "is-boxed" StyleToggle = "is-toggle" StyleToggleRounded = "is-toggle is-toggle-rounded" TableDefault = "" TableBordered = "is-bordered" TableStriped = "is-striped" TableNarrow = "is-narrow" TableHoverable = "is-hoverable" TableFullWidth = "is-fullwidth" )
Variables ¶
This section is empty.
Functions ¶
func BreadcrumbActive ¶
func BreadcrumbActiveIcon ¶
func BreadcrumbPrevious ¶
func BreadcrumbPreviousIcon ¶
func ButtonLink ¶ added in v0.1.5
func ButtonNewTab ¶
Helper Button that will add a ahref link that opens a new tab.
func CardFooterItem ¶
func CardHeaderIcon ¶
This is used to create a header within a card. Use this version if you want to have an icon added.
func DropdownMenuLink ¶
func DropdownMenuSeperator ¶
func DropdownTrigger ¶
Controls needs to match up with the same controls in the DropdownMenu() so it works together
func ExampleBreadcrumb ¶
func ExampleCard ¶
func ExampleDropdown ¶
func ExampleMenu ¶
func FormCheckbox ¶
func FormLabelSelectOne ¶
This is a helper that creates the following object for you.
Accepts Children
@bulma.NewFormField() { @bulma.FormLabel("Type") @bulma.FormControl() { @Newbulma.FormSelectOne("type", false) { @bulma.FormSelectOneItem("Playlist") @bulma.FormSelectOneItem("Artist") @bulma.FormSelectOneItem("Album") } } }
func FormLabelTextInput ¶
This is a helper to create the following object for you.
@bulma.NewFormField() { @bulma.FormLabel(label) @bulma.NewFormControl() { @bulma.FormTextInput(id, bulma.InputTypeText, placeholder) } }
func FormSelectManyItem ¶
func FormSelectOneItem ¶
func FormSubmit ¶
func FormTextArea ¶
func FormTextInput ¶
func FormTextInputWithValue ¶
Creates a text form that populates a default value. This one gives you the option to mark the field as readonly so users are unable to change the value.
func HxButtonLink ¶ added in v0.1.2
func HxButtonLink(color, size, text string, hx HtmxProperties) templ.Component
func HxDropdownMenuLink ¶ added in v0.1.2
func HxDropdownMenuLink(text string, hx HtmxProperties) templ.Component
func HxNavbarItem ¶ added in v0.1.2
func HxNavbarItem(text string, hx HtmxProperties) templ.Component
func HxTabLink ¶ added in v0.1.5
func HxTabLink(text string, isActive bool, hx HtmxProperties) templ.Component
func HxTabLinkIcon ¶ added in v0.1.5
func HxTabLinkIcon(text, fontAwesomeIcon string, isActive bool, hx HtmxProperties) templ.Component
func ImageSrc ¶
Creates an image object that defines the image under it. https://bulma.io/documentation/elements/image/
func MenuListItem ¶
func MessageWithHeader ¶
This is an optional item on the Message
func NavbarBrandBurger ¶
func NavbarExample ¶
This is an example on how to setup a Navbar. Don't use this in your project.
func NavbarItem ¶
func NavbarItemChildren ¶
This is ideal if you want to use something like svg
func NewBreadcrumb ¶
#region Breadcrumb https://bulma.io/documentation/components/breadcrumb/
func NewButton ¶ added in v0.1.0
This creates a button that accepts children under it. Accepts Children
func NewCardContent ¶ added in v0.1.0
a multi-purpose container for any other element
Accepts Children
func NewCardHeader ¶ added in v0.1.0
Creates a basic header for a Card that just has text
func NewColumn ¶ added in v0.1.0
Creates a new column that can accept multiple sizes. You can pass in multiple sizes, but start with one and add more if you need them.
func NewColumns ¶
Creates a new Columns container that accepts multiple column objects. This accepts multiple Columns... values.
func NewContainer ¶ added in v0.1.0
func NewContent ¶ added in v0.1.0
func NewDropdown ¶
Creates a dropdown menu.
func NewDropdownMenu ¶ added in v0.1.0
Accepts Children
func NewFlexGrid ¶ added in v0.1.0
func NewFormControl ¶ added in v0.1.0
Div container to add a input field to.
func NewFormField ¶ added in v0.1.0
This creates a field that you can add a Label, Control or Input object.
func NewFormSelectMany ¶ added in v0.1.0
func NewFormSelectManyColor ¶ added in v0.1.0
func NewFormSelectOne ¶ added in v0.1.0
func NewGridCell ¶ added in v0.1.0
func NewHxContainer ¶ added in v0.1.2
func NewHxContainer(breakpoint, id string, hx HtmxProperties) templ.Component
func NewHxTableBody ¶ added in v0.1.6
func NewHxTableBody(hx HtmxProperties) templ.Component
func NewImage ¶ added in v0.1.0
Creates a image wrapper. This accepts children. Use html.Img() to load a image as a child
func NewLevel ¶ added in v0.1.0
A multi-purpose horizontal level, which can contain almost any other element
Accepts Children ¶
func NewLevelItem ¶ added in v0.1.0
Creates a element within the Level object
func NewMediaContent ¶ added in v0.1.0
func NewMediaLeft ¶ added in v0.1.0
func NewMediaRight ¶ added in v0.1.0
func NewMenuList ¶ added in v0.1.0
func NewMessageBody ¶ added in v0.1.0
Accepts Children
Pass in the text with some basic html tags only. Should support @bulma.Content() but its not validated at this time.
func NewNavbarBrand ¶ added in v0.1.0
On the left side, always visible, which usually contains the logo and optionally some links or icons
Accepts Children
func NewNavbarEnd ¶ added in v0.1.5
func NewNavbarItemDropdown ¶ added in v0.1.0
func NewNavbarMenu ¶ added in v0.1.0
func NewNavbarStart ¶ added in v0.1.0
func NewPagination ¶
func NewPaginationList ¶ added in v0.1.0
func NewSection ¶ added in v0.1.0
Creates a <section> object thats good to break up a page of content.
Accepts Children ¶
func NewTableDataChildren ¶ added in v0.1.0
Creates a <td> that accepts children.
func NewTableHeader ¶ added in v0.1.0
Creates a <thead> that accepts children.
func NewTableRow ¶ added in v0.1.0
Creates a <tf> that accepts children.
func Notification ¶
func PaginationActive ¶
func PaginationEllispsis ¶
func PaginationExample ¶
func PaginationListItem ¶
func PaginationNext ¶
func PaginationPrevious ¶
func PanelBlock ¶
Supports contain other elements, like control input, button, panel-icon
func PanelHeader ¶
func PanelHeaderIcon ¶
func PanelTabItem ¶
func PanelTabItemActive ¶
func ProgressBar ¶
func RequiredModelScript ¶
This is required for models to work correctly. This needs to be placed at the end of your body tag.
https://bulma.io/documentation/components/modal/#javascript-implementation-example
func RequiredNavbarToggleScript ¶ added in v0.1.0
This script will toggle the navbar on mobile. This needs to be placed at the end of your body tag.
https://bulma.io/documentation/components/navbar/#navbar-menu
func TabLinkIcon ¶
func TableHeaderData ¶
Creates a <th> and writes the given value
func TableHeaderDataToolTip ¶
Creates a <th> that allows you to also add a tooltip value
func TableHeaderValues ¶ added in v0.1.2
Helper component that will create multiple Table Header items for you with just defining an slice
func UseBulmaCdn ¶
func UseThemeCatppuccinMocha ¶ added in v0.1.6
Enables the page to use a different color palet based on the Catppuccin Mocha values.
Add @bulma.UseThemeCatppuccinMocha() into your header. You should be able to add this to any element but it works best as a global theme set in your html tag.
<html lang="en" class="theme-catppuccin-mocha">
Types ¶
type HtmxProperties ¶ added in v0.1.2
type HtmxProperties struct { // The hx-get attribute will cause an element to issue a GET to the specified URL and swap the HTML into the DOM using a swap strategy // // https://htmx.org/attributes/hx-get/ HxGet string HxPost string HxTrigger string HxTarget string HxSwap string // The hx-boost attribute allows you to “boost” normal anchors and form tags to use AJAX instead // // https://htmx.org/attributes/hx-boost/ HxBoost bool // The hx-push-url attribute allows you to push a URL into the browser location history. // // https://htmx.org/attributes/hx-push-url/ HxPushUrl bool // The hx-confirm attribute allows you to confirm an action before issuing a request. // This can be useful in cases where the action is destructive and you want to ensure that the user really wants to do it. // //https://htmx.org/attributes/hx-confirm/ HxConfirm string }